diff options
47 files changed, 10053 insertions, 9435 deletions
diff --git a/epan/dissectors/packet-adwin.c b/epan/dissectors/packet-adwin.c index 239996adc9..6c1c05ab06 100644 --- a/epan/dissectors/packet-adwin.c +++ b/epan/dissectors/packet-adwin.c @@ -428,12 +428,12 @@ typedef enum { static const value_string packet_type_mapping[] = { { APT_UDPH1_old, "UDPH1 old"}, { APT_UDPH1_new, "UDPH1 new"}, - { APT_UDPR1, "UDPR1"}, - { APT_UDPR2, "UDPR2"}, - { APT_UDPR3, "UDPR3"}, - { APT_UDPR4, "UDPR4"}, - { APT_GDSHP, "GDSHP"}, - { APT_GDSHR, "GDSHR"}, + { APT_UDPR1, "UDPR1"}, + { APT_UDPR2, "UDPR2"}, + { APT_UDPR3, "UDPR3"}, + { APT_UDPR4, "UDPR4"}, + { APT_GDSHP, "GDSHP"}, + { APT_GDSHR, "GDSHR"}, { 0, NULL }, }; static value_string_ext packet_type_mapping_ext = VALUE_STRING_EXT_INIT(packet_type_mapping); @@ -515,8 +515,9 @@ typedef struct _adwin_conv_info_t { wmem_map_t *pdus; } adwin_conv_info_t; -typedef enum { ADWIN_REQUEST, - ADWIN_RESPONSE +typedef enum { + ADWIN_REQUEST, + ADWIN_RESPONSE } adwin_direction_t; static void @@ -1072,7 +1073,7 @@ dissect_GDSHR(tvbuff_t *tvb, packet_info *pinfo, is_range, "unknown code %d", is_range); } proto_item_set_len(ti, 12); - proto_tree_add_item(adwin_debug_tree, hf_adwin_unused, tvb, 24, 40, ENC_NA); + proto_tree_add_item(adwin_debug_tree, hf_adwin_unused, tvb, 24, 40, ENC_NA); } /* here we determine which type of packet is sent by looking at its @@ -1459,3 +1460,16 @@ proto_register_adwin(void) "should be dissected or not", &global_adwin_dissect_data); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-agentx.c b/epan/dissectors/packet-agentx.c index 7982f5fa01..29930c7b2f 100644 --- a/epan/dissectors/packet-agentx.c +++ b/epan/dissectors/packet-agentx.c @@ -236,36 +236,36 @@ static const value_string close_reasons[] = { static const value_string resp_errors[] = { - { AGENTX_NO_ERROR, "noError" }, - { AGENTX_TOO_BIG, "tooBig" }, - { AGENTX_NO_SUCH_NAME, "noSuchName" }, - { AGENTX_BAD_VALUE, "badValue" }, - { AGENTX_READ_ONLY, "readOnly" }, - { AGENTX_GEN_ERROR, "genErr" }, - { AGENTX_NO_ACCESS, "noAccess" }, - { AGENTX_WRONG_TYPE, "wrongType" }, - { AGENTX_WRONG_LEN, "wrongLength" }, - { AGENTX_WRONG_ENCODE, "wrongEncoding" }, - { AGENTX_WRONG_VALUE, "wrongValue" }, - { AGENTX_NO_CREATION, "noCreation" }, - { AGENTX_INCONSIST_VALUE, "inconsistentValue" }, - { AGENTX_RES_UNAVAIL, "resourceUnavailable" }, - { AGENTX_COMMIT_FAILED, "commitFailed" }, - { AGENTX_UNDO_FAILED , "undoFailed" }, - { AGENTX_AUTH_ERROR, "authorizationError" }, - { AGENTX_NOTWRITABLE, "notWritable" }, - { AGENTX_INCONSIS_NAME, "inconsistentName" }, - { AGENTX_OPEN_FAILED, "openFailed" }, - { AGENTX_NOT_OPEN, "notOpen" }, - { AGENTX_IDX_WRONT_TYPE, "indexWrongType" }, - { AGENTX_IDX_ALREAY_ALLOC, "indexAlreadyAllocated" }, - { AGENTX_IDX_NONEAVAIL, "indexNoneAvailable" }, - { AGENTX_IDX_NOTALLOC, "indexNotAllocated" }, - { AGENTX_UNSUPP_CONTEXT, "unsupportedContext" }, - { AGENTX_DUP_REGISTR, "duplicateRegistration" }, - { AGENTX_UNKNOWN_REG, "unknownRegistration" }, - { AGENTX_UNKNOWN_CAPS, "unknownAgentCaps" }, - { 0, NULL } + { AGENTX_NO_ERROR, "noError" }, + { AGENTX_TOO_BIG, "tooBig" }, + { AGENTX_NO_SUCH_NAME, "noSuchName" }, + { AGENTX_BAD_VALUE, "badValue" }, + { AGENTX_READ_ONLY, "readOnly" }, + { AGENTX_GEN_ERROR, "genErr" }, + { AGENTX_NO_ACCESS, "noAccess" }, + { AGENTX_WRONG_TYPE, "wrongType" }, + { AGENTX_WRONG_LEN, "wrongLength" }, + { AGENTX_WRONG_ENCODE, "wrongEncoding" }, + { AGENTX_WRONG_VALUE, "wrongValue" }, + { AGENTX_NO_CREATION, "noCreation" }, + { AGENTX_INCONSIST_VALUE, "inconsistentValue" }, + { AGENTX_RES_UNAVAIL, "resourceUnavailable" }, + { AGENTX_COMMIT_FAILED, "commitFailed" }, + { AGENTX_UNDO_FAILED , "undoFailed" }, + { AGENTX_AUTH_ERROR, "authorizationError" }, + { AGENTX_NOTWRITABLE, "notWritable" }, + { AGENTX_INCONSIS_NAME, "inconsistentName" }, + { AGENTX_OPEN_FAILED, "openFailed" }, + { AGENTX_NOT_OPEN, "notOpen" }, + { AGENTX_IDX_WRONT_TYPE, "indexWrongType" }, + { AGENTX_IDX_ALREAY_ALLOC, "indexAlreadyAllocated" }, + { AGENTX_IDX_NONEAVAIL, "indexNoneAvailable" }, + { AGENTX_IDX_NOTALLOC, "indexNotAllocated" }, + { AGENTX_UNSUPP_CONTEXT, "unsupportedContext" }, + { AGENTX_DUP_REGISTR, "duplicateRegistration" }, + { AGENTX_UNKNOWN_REG, "unknownRegistration" }, + { AGENTX_UNKNOWN_CAPS, "unknownAgentCaps" }, + { 0, NULL } }; static value_string_ext resp_errors_ext = VALUE_STRING_EXT_INIT(resp_errors); @@ -914,7 +914,7 @@ dissect_agentx_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da break; } - return tvb_captured_length(tvb); + return tvb_captured_length(tvb); } static int @@ -1148,3 +1148,16 @@ proto_reg_handoff_agentx(void) agentx_tcp_port = global_agentx_tcp_port; dissector_add_uint("tcp.port", agentx_tcp_port, agentx_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c index 0a453a44e0..0f40ecc626 100644 --- a/epan/dissectors/packet-aim.c +++ b/epan/dissectors/packet-aim.c @@ -78,39 +78,39 @@ void proto_reg_handoff_aim(void); #define FAMILY_ALL_ERROR_NOT_WHILE_ON_AOL 0x0018 static const value_string aim_flap_channels[] = { - { CHANNEL_NEW_CONN, "New Connection" }, - { CHANNEL_SNAC_DATA, "SNAC Data" }, - { CHANNEL_FLAP_ERR, "FLAP-Level Error" }, + { CHANNEL_NEW_CONN, "New Connection" }, + { CHANNEL_SNAC_DATA, "SNAC Data" }, + { CHANNEL_FLAP_ERR, "FLAP-Level Error" }, { CHANNEL_CLOSE_CONN, "Close Connection" }, { CHANNEL_KEEP_ALIVE, "Keep Alive" }, { 0, NULL } }; static const value_string aim_snac_errors[] = { - { FAMILY_ALL_ERROR_INVALID_HEADER, "Invalid SNAC Header" }, - { FAMILY_ALL_ERROR_SERVER_RATE_LIMIT_EXCEEDED, "Server rate limit exceeded" }, - { FAMILY_ALL_ERROR_CLIENT_RATE_LIMIT_EXCEEDED, "Client rate limit exceeded" }, - { FAMILY_ALL_ERROR_RECIPIENT_NOT_LOGGED_IN, "Recipient not logged in" }, + { FAMILY_ALL_ERROR_INVALID_HEADER, "Invalid SNAC Header" }, + { FAMILY_ALL_ERROR_SERVER_RATE_LIMIT_EXCEEDED, "Server rate limit exceeded" }, + { FAMILY_ALL_ERROR_CLIENT_RATE_LIMIT_EXCEEDED, "Client rate limit exceeded" }, + { FAMILY_ALL_ERROR_RECIPIENT_NOT_LOGGED_IN, "Recipient not logged in" }, { FAMILY_ALL_ERROR_REQUESTED_SERVICE_UNAVAILABLE, "Requested service unavailable" }, { FAMILY_ALL_ERROR_REQUESTED_SERVICE_NOT_DEFINED, "Requested service not defined" }, - { FAMILY_ALL_ERROR_OBSOLETE_SNAC, "Obsolete SNAC issued" }, - { FAMILY_ALL_ERROR_NOT_SUPPORTED_BY_SERVER, "Not supported by server" }, - { FAMILY_ALL_ERROR_NOT_SUPPORTED_BY_CLIENT, "Not supported by client" }, - { FAMILY_ALL_ERROR_REFUSED_BY_CLIENT, "Refused by client" }, - { FAMILY_ALL_ERROR_REPLY_TOO_BIG, "Reply too big" }, - { FAMILY_ALL_ERROR_RESPONSES_LOST, "Responses lost" }, - { FAMILY_ALL_ERROR_REQUEST_DENIED, "Request denied" }, - { FAMILY_ALL_ERROR_INCORRECT_SNAC_FORMAT, "Incorrect SNAC format" }, - { FAMILY_ALL_ERROR_INSUFFICIENT_RIGHTS, "Insufficient rights" }, - { FAMILY_ALL_ERROR_RECIPIENT_BLOCKED, "Recipient blocked" }, - { FAMILY_ALL_ERROR_SENDER_TOO_EVIL, "Sender too evil" }, - { FAMILY_ALL_ERROR_RECEIVER_TOO_EVIL, "Receiver too evil" }, - { FAMILY_ALL_ERROR_USER_TEMP_UNAVAILABLE, "User temporarily unavailable" }, - { FAMILY_ALL_ERROR_NO_MATCH, "No match" }, - { FAMILY_ALL_ERROR_LIST_OVERFLOW, "List overflow" }, - { FAMILY_ALL_ERROR_REQUEST_AMBIGUOUS, "Request ambiguous" }, - { FAMILY_ALL_ERROR_SERVER_QUEUE_FULL, "Server queue full" }, - { FAMILY_ALL_ERROR_NOT_WHILE_ON_AOL, "Not while on AOL" }, + { FAMILY_ALL_ERROR_OBSOLETE_SNAC, "Obsolete SNAC issued" }, + { FAMILY_ALL_ERROR_NOT_SUPPORTED_BY_SERVER, "Not supported by server" }, + { FAMILY_ALL_ERROR_NOT_SUPPORTED_BY_CLIENT, "Not supported by client" }, + { FAMILY_ALL_ERROR_REFUSED_BY_CLIENT, "Refused by client" }, + { FAMILY_ALL_ERROR_REPLY_TOO_BIG, "Reply too big" }, + { FAMILY_ALL_ERROR_RESPONSES_LOST, "Responses lost" }, + { FAMILY_ALL_ERROR_REQUEST_DENIED, "Request denied" }, + { FAMILY_ALL_ERROR_INCORRECT_SNAC_FORMAT, "Incorrect SNAC format" }, + { FAMILY_ALL_ERROR_INSUFFICIENT_RIGHTS, "Insufficient rights" }, + { FAMILY_ALL_ERROR_RECIPIENT_BLOCKED, "Recipient blocked" }, + { FAMILY_ALL_ERROR_SENDER_TOO_EVIL, "Sender too evil" }, + { FAMILY_ALL_ERROR_RECEIVER_TOO_EVIL, "Receiver too evil" }, + { FAMILY_ALL_ERROR_USER_TEMP_UNAVAILABLE, "User temporarily unavailable" }, + { FAMILY_ALL_ERROR_NO_MATCH, "No match" }, + { FAMILY_ALL_ERROR_LIST_OVERFLOW, "List overflow" }, + { FAMILY_ALL_ERROR_REQUEST_AMBIGUOUS, "Request ambiguous" }, + { FAMILY_ALL_ERROR_SERVER_QUEUE_FULL, "Server queue full" }, + { FAMILY_ALL_ERROR_NOT_WHILE_ON_AOL, "Not while on AOL" }, { 0, NULL } }; @@ -169,58 +169,58 @@ static const value_string aim_snac_errors[] = { #define AIM_CLIENT_TLV_FIRST_MESSAGE_SENT 0x0145 const aim_tlv aim_client_tlvs[] = { - { AIM_CLIENT_TLV_SCREEN_NAME, "Screen name", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_NEW_ROASTED_PASSWORD, "Roasted password array", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_OLD_ROASTED_PASSWORD, "Old roasted password array", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_CLIENT_ID_STRING, "Client id string (name, version)", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_CLIENT_ID, "Client id number", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_CLIENT_MAJOR_VERSION, "Client major version", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_CLIENT_MINOR_VERSION, "Client minor version", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_CLIENT_LESSER_VERSION, "Client lesser version", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_CLIENT_BUILD_NUMBER, "Client build number", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_PASSWORD_MD5, "Password Hash (MD5)", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_CLIENT_DISTRIBUTION_NUM, "Client distribution number", dissect_aim_tlv_value_uint32 }, - { AIM_CLIENT_TLV_CLIENT_LANGUAGE, "Client language", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_CLIENT_COUNTRY, "Client country", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_BOS_SERVER_STRING, "BOS server string", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_AUTH_COOKIE, "Authorization cookie", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_ERRORURL, "Error URL", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_ERRORCODE, "Error Code", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_DISCONNECT_REASON, "Disconnect Reason", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_RECONNECT_HOST, "Reconnect Hostname", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_URL, "URL", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_DEBUG_DATA, "Debug Data", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_EMAILADDR, "Account Email address", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_REGSTATUS, "Registration Status", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_LATESTBETABUILD, "Latest Beta Build", dissect_aim_tlv_value_uint32 }, - { AIM_CLIENT_TLV_LATESTBETAURL, "Latest Beta URL", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_LATESTBETAINFO, "Latest Beta Info", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_LATESTBETANAME, "Latest Beta Name", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_LATESTRELEASEBUILD, "Latest Release Build", dissect_aim_tlv_value_uint32 }, - { AIM_CLIENT_TLV_LATESTRELEASEURL, "Latest Release URL", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_LATESTRELEASEINFO, "Latest Release Info", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_LATESTRELEASENAME, "Latest Release Name", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_BETA_DIGEST_SIG, "Beta Digest Signature (MD5)" , dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_RELEASE_DIGEST_SIG, "Release Digest Signature (MD5)", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_CLIENTUSESSI, "Use SSI", dissect_aim_tlv_value_uint8 }, - { AIM_CLIENT_TLV_FAMILY_ID, "Service (SNAC Family) ID", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_CHANGE_PASSWORD_URL, "Change password url", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_AWAITING_AUTH, "Awaiting Authorization", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_MEMBERS, "Members of this Group", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_VISIBILITY_BITS, "Bitfield", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_PRIVACY, "Privacy Settings" , dissect_aim_tlv_value_uint8 }, - { AIM_CLIENT_TLV_VISIBLE_CLASS, "Visible To Classes", dissect_aim_tlv_value_userclass }, - { AIM_CLIENT_TLV_VISIBLE_MISC, "Allow Others to See Data", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_ICQ2K_SHORTCUT, "ICQ2K Shortcut List", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_FIRST_LOADED_TIME, "First Time Buddy Was Added (Unix Timestamp)" , dissect_aim_tlv_value_uint32 }, - { AIM_CLIENT_TLV_BUDDY_ICON_MD5SUM, "MD5SUM of Current Buddy Icon", dissect_aim_tlv_value_bytes }, - { AIM_CLIENT_TLV_GIVEN_NAME, "Locally Specified Buddy Name", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_LOCAL_EMAIL, "Locally Specified Buddy Email", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_LOCAL_SMS, "Locally Specified Buddy SMS", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_LOCAL_COMMENT, "Locally Specified Buddy Comment", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_LOCAL_PERSONAL_ALERT, "Personal Alert for Buddy", dissect_aim_tlv_value_uint16 }, - { AIM_CLIENT_TLV_LOCAL_PERSONAL_SOUND, "Personal Sound for Buddy", dissect_aim_tlv_value_string }, - { AIM_CLIENT_TLV_FIRST_MESSAGE_SENT, "First Time Message Sent to Buddy (Unix Timestamp)", dissect_aim_tlv_value_uint32 }, + { AIM_CLIENT_TLV_SCREEN_NAME, "Screen name", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_NEW_ROASTED_PASSWORD, "Roasted password array", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_OLD_ROASTED_PASSWORD, "Old roasted password array", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_CLIENT_ID_STRING, "Client id string (name, version)", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_CLIENT_ID, "Client id number", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_CLIENT_MAJOR_VERSION, "Client major version", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_CLIENT_MINOR_VERSION, "Client minor version", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_CLIENT_LESSER_VERSION, "Client lesser version", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_CLIENT_BUILD_NUMBER, "Client build number", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_PASSWORD_MD5, "Password Hash (MD5)", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_CLIENT_DISTRIBUTION_NUM, "Client distribution number", dissect_aim_tlv_value_uint32 }, + { AIM_CLIENT_TLV_CLIENT_LANGUAGE, "Client language", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_CLIENT_COUNTRY, "Client country", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_BOS_SERVER_STRING, "BOS server string", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_AUTH_COOKIE, "Authorization cookie", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_ERRORURL, "Error URL", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_ERRORCODE, "Error Code", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_DISCONNECT_REASON, "Disconnect Reason", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_RECONNECT_HOST, "Reconnect Hostname", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_URL, "URL", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_DEBUG_DATA, "Debug Data", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_EMAILADDR, "Account Email address", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_REGSTATUS, "Registration Status", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_LATESTBETABUILD, "Latest Beta Build", dissect_aim_tlv_value_uint32 }, + { AIM_CLIENT_TLV_LATESTBETAURL, "Latest Beta URL", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_LATESTBETAINFO, "Latest Beta Info", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_LATESTBETANAME, "Latest Beta Name", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_LATESTRELEASEBUILD, "Latest Release Build", dissect_aim_tlv_value_uint32 }, + { AIM_CLIENT_TLV_LATESTRELEASEURL, "Latest Release URL", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_LATESTRELEASEINFO, "Latest Release Info", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_LATESTRELEASENAME, "Latest Release Name", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_BETA_DIGEST_SIG, "Beta Digest Signature (MD5)" , dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_RELEASE_DIGEST_SIG, "Release Digest Signature (MD5)", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_CLIENTUSESSI, "Use SSI", dissect_aim_tlv_value_uint8 }, + { AIM_CLIENT_TLV_FAMILY_ID, "Service (SNAC Family) ID", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_CHANGE_PASSWORD_URL, "Change password url", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_AWAITING_AUTH, "Awaiting Authorization", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_MEMBERS, "Members of this Group", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_VISIBILITY_BITS, "Bitfield", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_PRIVACY, "Privacy Settings" , dissect_aim_tlv_value_uint8 }, + { AIM_CLIENT_TLV_VISIBLE_CLASS, "Visible To Classes", dissect_aim_tlv_value_userclass }, + { AIM_CLIENT_TLV_VISIBLE_MISC, "Allow Others to See Data", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_ICQ2K_SHORTCUT, "ICQ2K Shortcut List", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_FIRST_LOADED_TIME, "First Time Buddy Was Added (Unix Timestamp)" , dissect_aim_tlv_value_uint32 }, + { AIM_CLIENT_TLV_BUDDY_ICON_MD5SUM, "MD5SUM of Current Buddy Icon", dissect_aim_tlv_value_bytes }, + { AIM_CLIENT_TLV_GIVEN_NAME, "Locally Specified Buddy Name", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_LOCAL_EMAIL, "Locally Specified Buddy Email", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_LOCAL_SMS, "Locally Specified Buddy SMS", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_LOCAL_COMMENT, "Locally Specified Buddy Comment", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_LOCAL_PERSONAL_ALERT, "Personal Alert for Buddy", dissect_aim_tlv_value_uint16 }, + { AIM_CLIENT_TLV_LOCAL_PERSONAL_SOUND, "Personal Sound for Buddy", dissect_aim_tlv_value_string }, + { AIM_CLIENT_TLV_FIRST_MESSAGE_SENT, "First Time Message Sent to Buddy (Unix Timestamp)", dissect_aim_tlv_value_uint32 }, { 0, NULL, NULL } }; @@ -250,25 +250,25 @@ static int dissect_aim_tlv_value_client_short_capabilities(proto_item *ti, guint #define AIM_ONLINEBUDDY_GEOCOUNTRY 0x002a const aim_tlv aim_onlinebuddy_tlvs[] = { - { AIM_ONLINEBUDDY_USERCLASS, "User class", dissect_aim_tlv_value_userclass }, - { AIM_ONLINEBUDDY_ONSINCE, "Online since", dissect_aim_tlv_value_uint32 }, - { AIM_ONLINEBUDDY_IDLETIME, "Idle time (sec)", dissect_aim_tlv_value_uint16 }, - { AIM_ONLINEBUDDY_MEMBERSINCE, "Member since", dissect_aim_tlv_value_time }, - { AIM_ONLINEBUDDY_STATUS, "Online status", dissect_aim_tlv_value_userstatus }, - { AIM_ONLINEBUDDY_IPADDR, "User IP Address", dissect_aim_tlv_value_ipv4 }, - { AIM_ONLINEBUDDY_DCINFO, "DC Info", dissect_aim_tlv_value_dcinfo}, - { AIM_ONLINEBUDDY_CAPINFO, "Capability Info", dissect_aim_tlv_value_client_capabilities }, - { AIM_ONLINEBUDDY_TIMEUPDATE, "Time update", dissect_aim_tlv_value_bytes }, - { AIM_ONLINEBUDDY_SESSIONLEN, "Session Length (sec)", dissect_aim_tlv_value_uint32 }, + { AIM_ONLINEBUDDY_USERCLASS, "User class", dissect_aim_tlv_value_userclass }, + { AIM_ONLINEBUDDY_ONSINCE, "Online since", dissect_aim_tlv_value_uint32 }, + { AIM_ONLINEBUDDY_IDLETIME, "Idle time (sec)", dissect_aim_tlv_value_uint16 }, + { AIM_ONLINEBUDDY_MEMBERSINCE, "Member since", dissect_aim_tlv_value_time }, + { AIM_ONLINEBUDDY_STATUS, "Online status", dissect_aim_tlv_value_userstatus }, + { AIM_ONLINEBUDDY_IPADDR, "User IP Address", dissect_aim_tlv_value_ipv4 }, + { AIM_ONLINEBUDDY_DCINFO, "DC Info", dissect_aim_tlv_value_dcinfo}, + { AIM_ONLINEBUDDY_CAPINFO, "Capability Info", dissect_aim_tlv_value_client_capabilities }, + { AIM_ONLINEBUDDY_TIMEUPDATE, "Time update", dissect_aim_tlv_value_bytes }, + { AIM_ONLINEBUDDY_SESSIONLEN, "Session Length (sec)", dissect_aim_tlv_value_uint32 }, { AIM_ONLINEBUDDY_ICQSESSIONLEN, "ICQ Session Length (sec)", dissect_aim_tlv_value_uint32 }, { AIM_ONLINEBUDDY_MYINSTANCENUM, "Client instance number", dissect_aim_tlv_value_uint8 }, - { AIM_ONLINEBUDDY_SHORTCAPS, "Short Capabilities", dissect_aim_tlv_value_client_short_capabilities }, - { AIM_ONLINEBUDDY_BARTINFO, "BART Info", dissect_aim_tlv_value_bytes }, - { AIM_ONLINEBUDDY_NICKFLAGS2, "Upper bytes of Nick Flags", dissect_aim_tlv_value_bytes }, + { AIM_ONLINEBUDDY_SHORTCAPS, "Short Capabilities", dissect_aim_tlv_value_client_short_capabilities }, + { AIM_ONLINEBUDDY_BARTINFO, "BART Info", dissect_aim_tlv_value_bytes }, + { AIM_ONLINEBUDDY_NICKFLAGS2, "Upper bytes of Nick Flags", dissect_aim_tlv_value_bytes }, { AIM_ONLINEBUDDY_BUDDYFEEDTIME, "Last Buddy Feed update", dissect_aim_tlv_value_time }, - { AIM_ONLINEBUDDY_SIGTIME, "Profile set time", dissect_aim_tlv_value_time }, - { AIM_ONLINEBUDDY_AWAYTIME, "Away set time", dissect_aim_tlv_value_time }, - { AIM_ONLINEBUDDY_GEOCOUNTRY, "Country code", dissect_aim_tlv_value_string }, + { AIM_ONLINEBUDDY_SIGTIME, "Profile set time", dissect_aim_tlv_value_time }, + { AIM_ONLINEBUDDY_AWAYTIME, "Away set time", dissect_aim_tlv_value_time }, + { AIM_ONLINEBUDDY_GEOCOUNTRY, "Country code", dissect_aim_tlv_value_string }, { 0, NULL, NULL } }; @@ -279,10 +279,10 @@ const aim_tlv aim_onlinebuddy_tlvs[] = { #define DC_IMPOSSIBLE 0x0004 static const value_string dc_types[] = { - { DC_DISABLED, "DC disabled" }, - { DC_HTTPS, "DC thru firewall or HTTPS proxy" }, - { DC_SOCKS, "DC thru SOCKS proxy" }, - { DC_NORMAL, "Regular connection" }, + { DC_DISABLED, "DC disabled" }, + { DC_HTTPS, "DC thru firewall or HTTPS proxy" }, + { DC_SOCKS, "DC thru SOCKS proxy" }, + { DC_NORMAL, "Regular connection" }, { DC_IMPOSSIBLE, "DC not possible " }, { 0, NULL }, }; @@ -295,10 +295,10 @@ static const value_string dc_types[] = { #define PROTO_VERSION_ICQ2K3B 0x000A static const value_string protocol_versions[] = { - { PROTO_VERSION_ICQ98, "ICQ '98" }, - { PROTO_VERSION_ICQ99, "ICQ '99" }, - { PROTO_VERSION_ICQ2K, "ICQ 2000" }, - { PROTO_VERSION_ICQ2K1, "ICQ 2001" }, + { PROTO_VERSION_ICQ98, "ICQ '98" }, + { PROTO_VERSION_ICQ99, "ICQ '99" }, + { PROTO_VERSION_ICQ2K, "ICQ 2000" }, + { PROTO_VERSION_ICQ2K1, "ICQ 2001" }, { PROTO_VERSION_ICQLITE, "ICQ Lite" }, { PROTO_VERSION_ICQ2K3B, "ICQ 2003B" }, { 0, NULL }, @@ -344,11 +344,11 @@ static const aim_tlv aim_fnac_tlvs[] = { { 0, NULL, NULL } }; -#define SSI_OP_RESULT_SUCCESS 0 -#define SSI_OP_RESULT_DB_ERROR 1 -#define SSI_OP_RESULT_NOT_FOUND 2 -#define SSI_OP_RESULT_ALREADY_EXISTS 3 -#define SSI_OP_RESULT_UNAVAILABLE 5 +#define SSI_OP_RESULT_SUCCESS 0 +#define SSI_OP_RESULT_DB_ERROR 1 +#define SSI_OP_RESULT_NOT_FOUND 2 +#define SSI_OP_RESULT_ALREADY_EXISTS 3 +#define SSI_OP_RESULT_UNAVAILABLE 5 #define SSI_OP_RESULT_BAD_REQUEST 10 #define SSI_OP_RESULT_DB_TIME_OUT 11 #define SSI_OP_RESULT_OVER_ROW_LIMIT 12 @@ -360,20 +360,20 @@ static const aim_tlv aim_fnac_tlvs[] = { #define SSI_OP_RESULT_TIMEOUT 26 static const value_string aim_ssi_result_codes[] = { - { SSI_OP_RESULT_SUCCESS, "Success" }, - { SSI_OP_RESULT_DB_ERROR, "Some kind of database error" }, - { SSI_OP_RESULT_NOT_FOUND, "Item was not found for an update or delete" }, - { SSI_OP_RESULT_ALREADY_EXISTS, "Item already exists for an insert" }, - { SSI_OP_RESULT_UNAVAILABLE, "Server or database is not available" }, - { SSI_OP_RESULT_BAD_REQUEST, "Request was not formed well" }, - { SSI_OP_RESULT_DB_TIME_OUT, "Database timed out" }, - { SSI_OP_RESULT_OVER_ROW_LIMIT, "Too many items of this class for an insert" }, - { SSI_OP_RESULT_NOT_EXECUTED, "Not executed due to other error in same request" }, - { SSI_OP_RESULT_AUTH_REQUIRED, "Buddy List authorization required" }, - { SSI_OP_RESULT_BAD_LOGINID, "Bad loginId" }, - { SSI_OP_RESULT_OVER_BUDDY_LIMIT, "Too many buddies" }, + { SSI_OP_RESULT_SUCCESS, "Success" }, + { SSI_OP_RESULT_DB_ERROR, "Some kind of database error" }, + { SSI_OP_RESULT_NOT_FOUND, "Item was not found for an update or delete" }, + { SSI_OP_RESULT_ALREADY_EXISTS, "Item already exists for an insert" }, + { SSI_OP_RESULT_UNAVAILABLE, "Server or database is not available" }, + { SSI_OP_RESULT_BAD_REQUEST, "Request was not formed well" }, + { SSI_OP_RESULT_DB_TIME_OUT, "Database timed out" }, + { SSI_OP_RESULT_OVER_ROW_LIMIT, "Too many items of this class for an insert" }, + { SSI_OP_RESULT_NOT_EXECUTED, "Not executed due to other error in same request" }, + { SSI_OP_RESULT_AUTH_REQUIRED, "Buddy List authorization required" }, + { SSI_OP_RESULT_BAD_LOGINID, "Bad loginId" }, + { SSI_OP_RESULT_OVER_BUDDY_LIMIT, "Too many buddies" }, { SSI_OP_RESULT_INSERT_SMART_GROUP, "Attempt to added a Buddy to a smart group" }, - { SSI_OP_RESULT_TIMEOUT, "General timeout" }, + { SSI_OP_RESULT_TIMEOUT, "General timeout" }, { 0, NULL } }; @@ -1041,7 +1041,7 @@ dissect_aim_tlv_value_client_capabilities(proto_item *ti _U_, guint16 valueid _U entry = proto_item_add_subtree(ti, ett_aim_nickinfo_caps); - while (tvb_reported_length_remaining(tvb, offset) > 0) { + while (tvb_reported_length_remaining(tvb, offset) > 0) { offset = dissect_aim_capability(entry, tvb, offset); } @@ -1058,7 +1058,7 @@ dissect_aim_tlv_value_client_short_capabilities(proto_item *ti _U_, guint16 valu entry = proto_item_add_subtree(ti, ett_aim_nickinfo_short_caps); - while (tvb_reported_length_remaining(tvb, offset) > 0) { + while (tvb_reported_length_remaining(tvb, offset) > 0) { offset = dissect_aim_short_capability(entry, tvb, offset); } @@ -1124,7 +1124,7 @@ dissect_aim_tlv_value_dcinfo(proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb, proto_tree *dctree = proto_item_add_subtree(ti, ett_aim_dcinfo); - proto_tree_add_item(dctree, hf_aim_dcinfo_ip , tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; + proto_tree_add_item(dctree, hf_aim_dcinfo_ip , tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(dctree, hf_aim_dcinfo_tcpport, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item(dctree, hf_aim_dcinfo_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(dctree, hf_aim_dcinfo_proto_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; @@ -1723,3 +1723,16 @@ proto_reg_handoff_aim(void) aim_handle = new_create_dissector_handle(dissect_aim, proto_aim); dissector_add_uint("tcp.port", TCP_PORT_AIM, aim_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-cmpp.c b/epan/dissectors/packet-cmpp.c index 26e8f8fe0b..c703f2b2f6 100644 --- a/epan/dissectors/packet-cmpp.c +++ b/epan/dissectors/packet-cmpp.c @@ -149,6 +149,7 @@ static gboolean cmpp_desegment = TRUE; #define CMPP_PUSH_MT_ROUTE_UPDATE_RESP 0x80000015 #define CMPP_PUSH_MO_ROUTE_UPDATE_RESP 0x80000016 #define CMPP_GET_MO_ROUTE_RESP 0x80000017 + static const value_string vals_command_Id[] = { /* Operation */ { CMPP_CONNECT, "CMPP_CONNECT" }, { CMPP_CONNECT_RESP, "CMPP_CONNECT_RESP" }, @@ -983,3 +984,16 @@ proto_reg_handoff_cmpp(void) dissector_add_uint("tcp.port", CMPP_ISMG_LONG_PORT, cmpp_handle); dissector_add_uint("tcp.port", CMPP_ISMG_SHORT_PORT, cmpp_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-collectd.c b/epan/dissectors/packet-collectd.c index f3175f162d..abb10b7d64 100644 --- a/epan/dissectors/packet-collectd.c +++ b/epan/dissectors/packet-collectd.c @@ -699,7 +699,7 @@ dissect_collectd_part_values (tvbuff_t *tvb, packet_info *pinfo, gint offset, if (values_count != corrected_values_count) { pt = proto_tree_add_subtree_format(tree_root, tvb, offset, length, - ett_collectd_part_value, NULL, + ett_collectd_part_value, NULL, "collectd %s segment: %d (%d) value%s <BAD>", val_to_str_const (type, part_names, "UNKNOWN"), values_count, corrected_values_count, @@ -708,7 +708,7 @@ dissect_collectd_part_values (tvbuff_t *tvb, packet_info *pinfo, gint offset, else { pt = proto_tree_add_subtree_format(tree_root, tvb, offset, length, - ett_collectd_part_value, NULL, + ett_collectd_part_value, NULL, "collectd %s segment: %d value%s", val_to_str_const (type, part_names, "UNKNOWN"), values_count, @@ -1523,3 +1523,16 @@ void proto_reg_handoff_collectd (void) first_run = FALSE; } /* void proto_reg_handoff_collectd */ + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-ctdb.c b/epan/dissectors/packet-ctdb.c index 53147a1fa6..b6cac4ec7b 100644 --- a/epan/dissectors/packet-ctdb.c +++ b/epan/dissectors/packet-ctdb.c @@ -265,9 +265,9 @@ static int dissect_control_get_recmaster_reply(packet_info *pinfo, proto_tree *t } static const value_string recmode_vals[] = { - {0,"NORMAL"}, - {1,"RECOVERY ACTIVE"}, - {0,NULL} + {0, "NORMAL"}, + {1, "RECOVERY ACTIVE"}, + {0, NULL} }; static int dissect_control_get_recmode_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32 status, int endianess _U_) @@ -336,8 +336,8 @@ static int dissect_control_process_exist_request(packet_info *pinfo, proto_tree } static const true_false_string process_exists_tfs = { - "Process does NOT exist", - "Process Exists" + "Process does NOT exist", + "Process Exists" }; static int dissect_control_process_exist_reply(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, guint32 status, int endianess _U_) @@ -1249,3 +1249,16 @@ proto_reg_handoff_ctdb(void) heur_dissector_add("tcp", dissect_ctdb, proto_ctdb); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c index 131d2e0f60..abc74372ac 100644 --- a/epan/dissectors/packet-dcerpc-nt.c +++ b/epan/dissectors/packet-dcerpc-nt.c @@ -1957,3 +1957,16 @@ void dcerpc_smb_init(int proto_dcerpc) expert_register_field_array(expert_dcerpc_nt, ei, array_length(ei)); register_init_routine(&init_pol_hash); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c index 3fff9fb5f8..880a009e67 100644 --- a/epan/dissectors/packet-dcerpc-spoolss.c +++ b/epan/dissectors/packet-dcerpc-spoolss.c @@ -8567,3 +8567,16 @@ proto_reg_handoff_dcerpc_spoolss(void) &uuid_dcerpc_spoolss, ver_dcerpc_spoolss, dcerpc_spoolss_dissectors, hf_opnum); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c index d92a51836a..d4306897b4 100644 --- a/epan/dissectors/packet-dcm.c +++ b/epan/dissectors/packet-dcm.c @@ -177,10 +177,10 @@ * - fix memory leak when Assoc packet is processed repeatedly in wireshark * - removed unused partial packet flag * - added better support for DICOM VR - * - sequences - * - report actual VR in packet display, if supplied by xfer syntax - * - show that we are not displaying entire tag string with '[...]', - * some tags can hold up to 2^32-1 chars + * - sequences + * - report actual VR in packet display, if supplied by xfer syntax + * - show that we are not displaying entire tag string with '[...]', + * some tags can hold up to 2^32-1 chars * * - remove my goofy attempt at trying to get access to the fragmented packets * - process all the data in the Assoc packet even if display is off @@ -234,24 +234,24 @@ void proto_reg_handoff_dcm(void); #define DICOM_DEFAULT_RANGE "104" /* Many thanks to http://medicalconnections.co.uk/ for the GUID */ -#define WIRESHARK_IMPLEMENTATION_UID "1.2.826.0.1.3680043.8.427.10" -#define WIRESHARK_MEDIA_STORAGE_SOP_CLASS_UID "1.2.826.0.1.3680043.8.427.11.1" -#define WIRESHARK_MEDIA_STORAGE_SOP_INSTANCE_UID_PREFIX "1.2.826.0.1.3680043.8.427.11.2" -#define WIRESHARK_IMPLEMENTATION_VERSION "WIRESHARK" +#define WIRESHARK_IMPLEMENTATION_UID "1.2.826.0.1.3680043.8.427.10" +#define WIRESHARK_MEDIA_STORAGE_SOP_CLASS_UID "1.2.826.0.1.3680043.8.427.11.1" +#define WIRESHARK_MEDIA_STORAGE_SOP_INSTANCE_UID_PREFIX "1.2.826.0.1.3680043.8.427.11.2" +#define WIRESHARK_IMPLEMENTATION_VERSION "WIRESHARK" -#define MAX_BUF_LEN 1024 /* Used for string allocations */ +#define MAX_BUF_LEN 1024 /* Used for string allocations */ static range_t *global_dcm_tcp_range = NULL; -static range_t *global_dcm_tcp_range_backup = NULL; /* needed to deregister */ +static range_t *global_dcm_tcp_range_backup = NULL; /* needed to deregister */ static gboolean global_dcm_heuristic = FALSE; static gboolean global_dcm_export_header = TRUE; -static guint global_dcm_export_minsize = 4096; /* Filter small objects in export */ +static guint global_dcm_export_minsize = 4096; /* Filter small objects in export */ static gboolean global_dcm_seq_subtree = TRUE; -static gboolean global_dcm_tag_subtree = FALSE; /* Only useful for debugging */ -static gboolean global_dcm_cmd_details = TRUE; /* Show details in header and info column */ -static gboolean global_dcm_reassemble = TRUE; /* Merge fragmented PDVs */ +static gboolean global_dcm_tag_subtree = FALSE; /* Only useful for debugging */ +static gboolean global_dcm_cmd_details = TRUE; /* Show details in header and info column */ +static gboolean global_dcm_reassemble = TRUE; /* Merge fragmented PDVs */ static GHashTable *dcm_tag_table = NULL; static GHashTable *dcm_uid_table = NULL; @@ -443,24 +443,24 @@ typedef struct dcm_open_tag { */ - gboolean is_header_fragmented; - gboolean is_value_fragmented; + gboolean is_header_fragmented; + gboolean is_value_fragmented; - guint32 len_decoded; /* Should only be < 16 bytes */ + guint32 len_decoded; /* Should only be < 16 bytes */ - guint16 grp; /* Already decoded group */ - guint16 elm; /* Already decoded element */ - gchar *vr; /* Already decoded VR */ + guint16 grp; /* Already decoded group */ + guint16 elm; /* Already decoded element */ + gchar *vr; /* Already decoded VR */ - gboolean is_vl_long; /* If TRUE, Value Length is 4 Bytes, otherwise 2 */ - guint16 vl_1; /* Partially decoded 1st two bytes of length */ - guint16 vl_2; /* Partially decoded 2nd two bytes of length */ + gboolean is_vl_long; /* If TRUE, Value Length is 4 Bytes, otherwise 2 */ + guint16 vl_1; /* Partially decoded 1st two bytes of length */ + guint16 vl_2; /* Partially decoded 2nd two bytes of length */ /* These ones are, where the value was truncated */ - guint32 len_total; /* Tag length of 'oversized' tags. Used for display */ - guint32 len_remaining; /* Remaining tag bytes to 'decoded' as binary data after this PDV */ + guint32 len_total; /* Tag length of 'oversized' tags. Used for display */ + guint32 len_remaining; /* Remaining tag bytes to 'decoded' as binary data after this PDV */ - gchar *desc; /* Last decoded description */ + gchar *desc; /* Last decoded description */ } dcm_open_tag_t; @@ -471,49 +471,49 @@ typedef struct dcm_state_pdv { struct dcm_state_pdv *next, *prev; - guint32 packet_no; /* Wireshark packet number, where pdv starts */ - guint32 offset; /* Offset in packet, where PDV header starts */ + guint32 packet_no; /* Wireshark packet number, where pdv starts */ + guint32 offset; /* Offset in packet, where PDV header starts */ - gchar *desc; /* PDV description. wmem_file_scope() */ + gchar *desc; /* PDV description. wmem_file_scope() */ - guint8 pctx_id; /* Reference to used Presentation Context */ + guint8 pctx_id; /* Reference to used Presentation Context */ /* Following is derived from the transfer syntax in the parent PCTX, except for Command PDVs */ guint8 syntax; /* Used and filled for Export Object only */ - gpointer data; /* Copy of PDV data without any PDU/PDV header */ - guint32 data_len; /* Length of this PDV buffer. If >0, memory has been allocated */ + gpointer data; /* Copy of PDV data without any PDU/PDV header */ + guint32 data_len; /* Length of this PDV buffer. If >0, memory has been allocated */ - gchar *sop_class_uid; /* SOP Class UID. Set in 1st PDV of a DICOM object. wmem_file_scope() */ - gchar *sop_instance_uid; /* SOP Instance UID. Set in 1st PDV of a DICOM object. wmem_file_scope() */ + gchar *sop_class_uid; /* SOP Class UID. Set in 1st PDV of a DICOM object. wmem_file_scope() */ + gchar *sop_instance_uid; /* SOP Instance UID. Set in 1st PDV of a DICOM object. wmem_file_scope() */ /* End Export use */ - gboolean is_storage; /* True, if the Data PDV is on the context of a storage SOP Class */ - gboolean is_flagvalid; /* The following two flags are initialized correctly */ - gboolean is_command; /* This PDV is a command rather than a data package */ - gboolean is_last_fragment; /* Last Fragment bit was set, i.e. termination of an object - This flag delimits different dicom object in the same - association */ - gboolean is_corrupt; /* Early termination of long PDVs */ + gboolean is_storage; /* True, if the Data PDV is on the context of a storage SOP Class */ + gboolean is_flagvalid; /* The following two flags are initialized correctly */ + gboolean is_command; /* This PDV is a command rather than a data package */ + gboolean is_last_fragment; /* Last Fragment bit was set, i.e. termination of an object + This flag delimits different dicom object in the same + association */ + gboolean is_corrupt; /* Early termination of long PDVs */ - /* The following five attributes are only used from command PDVs */ + /* The following five attributes are only used from command PDVs */ - gchar *command; /* Decoded command as text */ + gchar *command; /* Decoded command as text */ gchar *status; - gchar *comment; /* Error comment, if any */ + gchar *comment; /* Error comment, if any */ - gboolean is_warning; /* Command response is a cancel, warning, error */ + gboolean is_warning; /* Command response is a cancel, warning, error */ - guint16 message_id; /* (0000,0110) Message ID */ - guint16 message_id_resp; /* (0000,0120) Message ID Being Responded To */ + guint16 message_id; /* (0000,0110) Message ID */ + guint16 message_id_resp; /* (0000,0120) Message ID Being Responded To */ - guint16 no_remaining; /* (0000,1020) Number of Remaining Sub-operations */ - guint16 no_completed; /* (0000,1021) Number of Completed Sub-operations */ - guint16 no_failed; /* (0000,1022) Number of Failed Sub-operations */ - guint16 no_warning; /* (0000,1023) Number of Warning Sub-operations */ + guint16 no_remaining; /* (0000,1020) Number of Remaining Sub-operations */ + guint16 no_completed; /* (0000,1021) Number of Completed Sub-operations */ + guint16 no_failed; /* (0000,1022) Number of Failed Sub-operations */ + guint16 no_warning; /* (0000,1023) Number of Warning Sub-operations */ - dcm_open_tag_t open_tag; /* Container to store information about a fragmented tag */ + dcm_open_tag_t open_tag; /* Container to store information about a fragmented tag */ } dcm_state_pdv_t; @@ -524,18 +524,18 @@ typedef struct dcm_state_pctx { struct dcm_state_pctx *next, *prev; - guint8 id; /* 0x20 Presentation Context ID */ - gchar *abss_uid; /* 0x30 Abstract syntax */ - gchar *abss_desc; /* 0x30 Abstract syntax decoded*/ - gchar *xfer_uid; /* 0x40 Accepted Transfer syntax */ - gchar *xfer_desc; /* 0x40 Accepted Transfer syntax decoded*/ - guint8 syntax; /* Decoded transfer syntax */ -#define DCM_ILE 0x01 /* implicit, little endian */ + guint8 id; /* 0x20 Presentation Context ID */ + gchar *abss_uid; /* 0x30 Abstract syntax */ + gchar *abss_desc; /* 0x30 Abstract syntax decoded*/ + gchar *xfer_uid; /* 0x40 Accepted Transfer syntax */ + gchar *xfer_desc; /* 0x40 Accepted Transfer syntax decoded*/ + guint8 syntax; /* Decoded transfer syntax */ +#define DCM_ILE 0x01 /* implicit, little endian */ #define DCM_EBE 0x02 /* explicit, big endian */ #define DCM_ELE 0x03 /* explicit, little endian */ #define DCM_UNK 0xf0 - dcm_state_pdv_t *first_pdv, *last_pdv; /* List of PDV objects */ + dcm_state_pdv_t *first_pdv, *last_pdv; /* List of PDV objects */ } dcm_state_pctx_t; @@ -544,15 +544,15 @@ typedef struct dcm_state_assoc { struct dcm_state_assoc *next, *prev; - dcm_state_pctx_t *first_pctx, *last_pctx; /* List of Presentation context objects */ + dcm_state_pctx_t *first_pctx, *last_pctx; /* List of Presentation context objects */ - guint32 packet_no; /* Wireshark packet number, where association starts */ + guint32 packet_no; /* Wireshark packet number, where association starts */ #define AEEND 16 - gchar ae_called[1+AEEND]; /* Called AE tilte in A-ASSOCIATE RQ */ - gchar ae_calling[1+AEEND]; /* Calling AE tilte in A-ASSOCIATE RQ */ - gchar ae_called_resp[1+AEEND]; /* Called AE tilte in A-ASSOCIATE RP */ - gchar ae_calling_resp[1+AEEND]; /* Calling AE tilte in A-ASSOCIATE RP */ + gchar ae_called[1+AEEND]; /* Called AE tilte in A-ASSOCIATE RQ */ + gchar ae_calling[1+AEEND]; /* Calling AE tilte in A-ASSOCIATE RQ */ + gchar ae_called_resp[1+AEEND]; /* Called AE tilte in A-ASSOCIATE RP */ + gchar ae_calling_resp[1+AEEND]; /* Calling AE tilte in A-ASSOCIATE RP */ } dcm_state_assoc_t; @@ -560,7 +560,7 @@ typedef struct dcm_state { struct dcm_state_assoc *first_assoc, *last_assoc; - gboolean valid; /* this conversation is a DICOM conversation */ + gboolean valid; /* this conversation is a DICOM conversation */ } dcm_state_t; @@ -618,72 +618,72 @@ static dcm_status_t dcm_status_data[] = { /* From PS 3.7 */ - { 0x0000, "Success"}, - { 0x0105, "No such attribute"}, - { 0x0106, "Invalid attribute value"}, - { 0x0107, "Attribute list error"}, - { 0x0110, "Processing failure"}, - { 0x0111, "Duplicate SOP instance"}, - { 0x0112, "No Such object instance"}, - { 0x0113, "No such event type"}, - { 0x0114, "No such argument"}, - { 0x0115, "Invalid argument value"}, - { 0x0116, "Attribute Value Out of Range"}, - { 0x0117, "Invalid object instance"}, - { 0x0118, "No Such SOP class"}, - { 0x0119, "Class-instance conflict"}, - { 0x0120, "Missing attribute"}, - { 0x0121, "Missing attribute value"}, - { 0x0122, "Refused: SOP class not supported"}, - { 0x0123, "No such action type"}, - { 0x0210, "Duplicate invocation"}, - { 0x0211, "Unrecognized operation"}, - { 0x0212, "Mistyped argument"}, - { 0x0213, "Resource limitation"}, - { 0xFE00, "Cancel"}, + { 0x0000, "Success"}, + { 0x0105, "No such attribute"}, + { 0x0106, "Invalid attribute value"}, + { 0x0107, "Attribute list error"}, + { 0x0110, "Processing failure"}, + { 0x0111, "Duplicate SOP instance"}, + { 0x0112, "No Such object instance"}, + { 0x0113, "No such event type"}, + { 0x0114, "No such argument"}, + { 0x0115, "Invalid argument value"}, + { 0x0116, "Attribute Value Out of Range"}, + { 0x0117, "Invalid object instance"}, + { 0x0118, "No Such SOP class"}, + { 0x0119, "Class-instance conflict"}, + { 0x0120, "Missing attribute"}, + { 0x0121, "Missing attribute value"}, + { 0x0122, "Refused: SOP class not supported"}, + { 0x0123, "No such action type"}, + { 0x0210, "Duplicate invocation"}, + { 0x0211, "Unrecognized operation"}, + { 0x0212, "Mistyped argument"}, + { 0x0213, "Resource limitation"}, + { 0xFE00, "Cancel"}, /* from PS 3.4 */ - { 0x0001, "Requested optional Attributes are not supported"}, - { 0xA501, "Refused because General Purpose Scheduled Procedure Step Object may no longer be updated"}, - { 0xA502, "Refused because the wrong Transaction UID is used"}, - { 0xA503, "Refused because the General Purpose Scheduled Procedure Step SOP Instance is already in the 'IN PROGRESS' state"}, - { 0xA504, "Refused because the related General Purpose Scheduled Procedure Step SOP Instance is not in the 'IN PROGRESS' state"}, - { 0xA505, "Refused because Referenced General Purpose Scheduled Procedure Step Transaction UID does not match the Transaction UID of the N-ACTION request"}, - { 0xA510, "Refused because an Initiate Media Creation action has already been received for this SOP Instance"}, - { 0xA700, "Refused: Out of Resources"}, - { 0xA701, "Refused: Out of Resources - Unable to calculate number of matches"}, - { 0xA702, "Refused: Out of Resources - Unable to perform sub-operations"}, + { 0x0001, "Requested optional Attributes are not supported"}, + { 0xA501, "Refused because General Purpose Scheduled Procedure Step Object may no longer be updated"}, + { 0xA502, "Refused because the wrong Transaction UID is used"}, + { 0xA503, "Refused because the General Purpose Scheduled Procedure Step SOP Instance is already in the 'IN PROGRESS' state"}, + { 0xA504, "Refused because the related General Purpose Scheduled Procedure Step SOP Instance is not in the 'IN PROGRESS' state"}, + { 0xA505, "Refused because Referenced General Purpose Scheduled Procedure Step Transaction UID does not match the Transaction UID of the N-ACTION request"}, + { 0xA510, "Refused because an Initiate Media Creation action has already been received for this SOP Instance"}, + { 0xA700, "Refused: Out of Resources"}, + { 0xA701, "Refused: Out of Resources - Unable to calculate number of matches"}, + { 0xA702, "Refused: Out of Resources - Unable to perform sub-operations"}, /* - { 0xA7xx, "Refused: Out of Resources"}, + { 0xA7xx, "Refused: Out of Resources"}, */ - { 0xA801, "Refused: Move Destination unknown"}, + { 0xA801, "Refused: Move Destination unknown"}, /* - { 0xA9xx, "Error: Data Set does not match SOP Class"}, + { 0xA9xx, "Error: Data Set does not match SOP Class"}, */ - { 0xB000, "Sub-operations Complete - One or more Failures"}, - { 0xB006, "Elements Discarded"}, - { 0xB007, "Data Set does not match SOP Class"}, - { 0xB101, "Specified Synchronization Frame of Reference UID does not match SCP Synchronization Frame of Reference"}, - { 0xB102, "Study Instance UID coercion; Event logged under a different Study Instance UID"}, - { 0xB104, "IDs inconsistent in matching a current study; Event logged"}, - { 0xB605, "Requested Min Density or Max Density outside of printer's operating range. The printer will use its respective minimum or maximum density value instead"}, - { 0xC000, "Error: Cannot understand/Unable to process"}, - { 0xC100, "More than one match found"}, - { 0xC101, "Procedural Logging not available for specified Study Instance UID"}, - { 0xC102, "Event Information does not match Template"}, - { 0xC103, "Cannot match event to a current study"}, - { 0xC104, "IDs inconsistent in matching a current study; Event not logged"}, - { 0xC200, "Unable to support requested template"}, - { 0xC201, "Media creation request already completed"}, - { 0xC202, "Media creation request already in progress and cannot be interrupted"}, - { 0xC203, "Cancellation denied for unspecified reason"}, + { 0xB000, "Sub-operations Complete - One or more Failures"}, + { 0xB006, "Elements Discarded"}, + { 0xB007, "Data Set does not match SOP Class"}, + { 0xB101, "Specified Synchronization Frame of Reference UID does not match SCP Synchronization Frame of Reference"}, + { 0xB102, "Study Instance UID coercion; Event logged under a different Study Instance UID"}, + { 0xB104, "IDs inconsistent in matching a current study; Event logged"}, + { 0xB605, "Requested Min Density or Max Density outside of printer's operating range. The printer will use its respective minimum or maximum density value instead"}, + { 0xC000, "Error: Cannot understand/Unable to process"}, + { 0xC100, "More than one match found"}, + { 0xC101, "Procedural Logging not available for specified Study Instance UID"}, + { 0xC102, "Event Information does not match Template"}, + { 0xC103, "Cannot match event to a current study"}, + { 0xC104, "IDs inconsistent in matching a current study; Event not logged"}, + { 0xC200, "Unable to support requested template"}, + { 0xC201, "Media creation request already completed"}, + { 0xC202, "Media creation request already in progress and cannot be interrupted"}, + { 0xC203, "Cancellation denied for unspecified reason"}, /* - { 0xCxxx, "Error: Cannot understand/Unable to Process"}, - { 0xFE00, "Matching/Sub-operations terminated due to Cancel request"}, + { 0xCxxx, "Error: Cannot understand/Unable to Process"}, + { 0xFE00, "Matching/Sub-operations terminated due to Cancel request"}, */ - { 0xFF00, "Current Match is supplied. Sub-operations are continuing"}, - { 0xFF01, "Matches are continuing - Warning that one or more Optional Keys were not supported for existence for this Identifier"} + { 0xFF00, "Current Match is supplied. Sub-operations are continuing"}, + { 0xFF01, "Matches are continuing - Warning that one or more Optional Keys were not supported for existence for this Identifier"} }; @@ -711,7 +711,7 @@ typedef struct dcm_tag { const gchar *vr; const gchar *vm; const gboolean is_retired; - const gboolean add_to_summary; /* Add to parent's item description */ + const gboolean add_to_summary; /* Add to parent's item description */ } dcm_tag_t; static dcm_tag_t dcm_tag_data[] = { @@ -3913,7 +3913,7 @@ static dcm_uid_t dcm_uid_data[] = { }; /* following definitions are used to call dissect_dcm_assoc_item() */ -#define DCM_ITEM_VALUE_TYPE_UID 1 +#define DCM_ITEM_VALUE_TYPE_UID 1 #define DCM_ITEM_VALUE_TYPE_STRING 2 #define DCM_ITEM_VALUE_TYPE_UINT32 3 @@ -3921,42 +3921,42 @@ static dcm_uid_t dcm_uid_data[] = { /* Per object, a xxx_new() and a xxx_get() function. The _get() will create one if specified. */ -static dcm_state_t* dcm_state_new(void); -static dcm_state_t* dcm_state_get(packet_info *pinfo, gboolean create); +static dcm_state_t* dcm_state_new(void); +static dcm_state_t* dcm_state_get(packet_info *pinfo, gboolean create); static dcm_state_assoc_t* dcm_state_assoc_new (dcm_state_t *dcm_data, guint32 packet_no); static dcm_state_assoc_t* dcm_state_assoc_get (dcm_state_t *dcm_data, guint32 packet_no, gboolean create); -static dcm_state_pctx_t* dcm_state_pctx_new (dcm_state_assoc_t *assoc, guint8 pctx_id); -static dcm_state_pctx_t* dcm_state_pctx_get (dcm_state_assoc_t *assoc, guint8 pctx_id, gboolean create); -static dcm_state_pdv_t* dcm_state_pdv_new (dcm_state_pctx_t *pctx, guint32 packet_no, guint32 offset); -static dcm_state_pdv_t* dcm_state_pdv_get (dcm_state_pctx_t *pctx, guint32 packet_no, guint32 offset, gboolean create); +static dcm_state_pctx_t* dcm_state_pctx_new (dcm_state_assoc_t *assoc, guint8 pctx_id); +static dcm_state_pctx_t* dcm_state_pctx_get (dcm_state_assoc_t *assoc, guint8 pctx_id, gboolean create); +static dcm_state_pdv_t* dcm_state_pdv_new (dcm_state_pctx_t *pctx, guint32 packet_no, guint32 offset); +static dcm_state_pdv_t* dcm_state_pdv_get (dcm_state_pctx_t *pctx, guint32 packet_no, guint32 offset, gboolean create); /* ToDo: The heuristic one should actually return true/false only */ static int dissect_dcm_heuristic (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data); -static int dissect_dcm_main (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_port_static); +static int dissect_dcm_main (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_port_static); /* And from here on, only use unsigned 32 bit values. Offset is always positive number in respect to the tvb buffer start */ -static guint32 dissect_dcm_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset); +static guint32 dissect_dcm_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset); static guint32 dissect_dcm_assoc_detail(tvbuff_t *tvb, packet_info *pinfo, proto_item *ti, dcm_state_assoc_t *assoc, guint32 offset, guint32 len); -static void dissect_dcm_pctx (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_assoc_t *assoc, guint32 offset, guint32 len, const gchar *pitem_prefix, gboolean request); -static void dissect_dcm_assoc_item (tvbuff_t *tvb, proto_tree *tree, guint32 offset, const gchar *pitem_prefix, int item_value_type, gchar **item_value, const gchar **item_description, int *hf_type, int *hf_len, int *hf_value, int ett_subtree); -static void dissect_dcm_userinfo (tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 len, const gchar *pitem_prefix); +static void dissect_dcm_pctx (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_assoc_t *assoc, guint32 offset, guint32 len, const gchar *pitem_prefix, gboolean request); +static void dissect_dcm_assoc_item (tvbuff_t *tvb, proto_tree *tree, guint32 offset, const gchar *pitem_prefix, int item_value_type, gchar **item_value, const gchar **item_description, int *hf_type, int *hf_len, int *hf_value, int ett_subtree); +static void dissect_dcm_userinfo (tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 len, const gchar *pitem_prefix); static void dissect_dcm_assoc_sopclass_extneg(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_dcm_assoc_role_selection(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_dcm_assoc_async_negotiation(tvbuff_t *tvb, proto_tree *tree, guint32 offset); -static guint32 dissect_dcm_pdu_data (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_assoc_t *assoc, guint32 offset, guint32 pdu_len, gchar **pdu_data_description); -static guint32 dissect_dcm_pdv_header (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_assoc_t *assoc, guint32 offset, dcm_state_pdv_t **pdv); -static guint32 dissect_dcm_pdv_fragmented (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_assoc_t *assoc, guint32 offset, guint32 pdv_len, gchar **pdv_description); -static guint32 dissect_dcm_pdv_body (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv, guint32 offset, guint32 pdv_body_len, gchar **pdv_description); +static guint32 dissect_dcm_pdu_data (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_assoc_t *assoc, guint32 offset, guint32 pdu_len, gchar **pdu_data_description); +static guint32 dissect_dcm_pdv_header (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_assoc_t *assoc, guint32 offset, dcm_state_pdv_t **pdv); +static guint32 dissect_dcm_pdv_fragmented (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_assoc_t *assoc, guint32 offset, guint32 pdv_len, gchar **pdv_description); +static guint32 dissect_dcm_pdv_body (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv, guint32 offset, guint32 pdv_body_len, gchar **pdv_description); -static guint32 dissect_dcm_tag (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv, guint32 offset, guint32 endpos, gboolean is_first_tag, const gchar **tag_description, gboolean *end_of_seq_or_item); -static guint32 dissect_dcm_tag_open (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv, guint32 offset, guint32 endpos, gboolean *is_first_tag); -static guint32 dissect_dcm_tag_value (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv, guint32 offset, guint16 grp, guint16 elm, guint32 vl, guint32 vl_max, const gchar* vr, gchar **tag_value); +static guint32 dissect_dcm_tag (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv, guint32 offset, guint32 endpos, gboolean is_first_tag, const gchar **tag_description, gboolean *end_of_seq_or_item); +static guint32 dissect_dcm_tag_open (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv, guint32 offset, guint32 endpos, gboolean *is_first_tag); +static guint32 dissect_dcm_tag_value (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv, guint32 offset, guint16 grp, guint16 elm, guint32 vl, guint32 vl_max, const gchar* vr, gchar **tag_value); -static void dcm_set_syntax (dcm_state_pctx_t *pctx, gchar *xfer_uid, const gchar *xfer_desc); -static void dcm_export_create_object (packet_info *pinfo, dcm_state_assoc_t *assoc, dcm_state_pdv_t *pdv); +static void dcm_set_syntax (dcm_state_pctx_t *pctx, gchar *xfer_uid, const gchar *xfer_desc); +static void dcm_export_create_object (packet_info *pinfo, dcm_state_assoc_t *assoc, dcm_state_pdv_t *pdv); static void @@ -3966,29 +3966,29 @@ dcm_init(void) /* Add UID objects to hash table */ if (dcm_uid_table == NULL) { - dcm_uid_table = g_hash_table_new(g_str_hash, g_str_equal); - for (i = 0; i < array_length(dcm_uid_data); i++) { - g_hash_table_insert(dcm_uid_table, (gpointer) dcm_uid_data[i].value, - (gpointer) &dcm_uid_data[i]); - } + dcm_uid_table = g_hash_table_new(g_str_hash, g_str_equal); + for (i = 0; i < array_length(dcm_uid_data); i++) { + g_hash_table_insert(dcm_uid_table, (gpointer) dcm_uid_data[i].value, + (gpointer) &dcm_uid_data[i]); + } } /* Add Tag objects to hash table */ if (dcm_tag_table == NULL) { - dcm_tag_table = g_hash_table_new(NULL, NULL); - for (i = 0; i < array_length(dcm_tag_data); i++) { - g_hash_table_insert(dcm_tag_table, GUINT_TO_POINTER(dcm_tag_data[i].tag), - (gpointer) &dcm_tag_data[i]); - } + dcm_tag_table = g_hash_table_new(NULL, NULL); + for (i = 0; i < array_length(dcm_tag_data); i++) { + g_hash_table_insert(dcm_tag_table, GUINT_TO_POINTER(dcm_tag_data[i].tag), + (gpointer) &dcm_tag_data[i]); + } } /* Add Status Values to hash table */ if (dcm_status_table == NULL) { - dcm_status_table = g_hash_table_new(NULL, NULL); - for (i = 0; i < array_length(dcm_status_data); i++) { - g_hash_table_insert(dcm_status_table, GUINT_TO_POINTER((guint32)dcm_status_data[i].value), - (gpointer)&dcm_status_data[i]); - } + dcm_status_table = g_hash_table_new(NULL, NULL); + for (i = 0; i < array_length(dcm_status_data); i++) { + g_hash_table_insert(dcm_status_table, GUINT_TO_POINTER((guint32)dcm_status_data[i].value), + (gpointer)&dcm_status_data[i]); + } } /* Register processing of fragmented DICOM PDVs */ @@ -4011,38 +4011,38 @@ static dcm_state_t * dcm_state_get(packet_info *pinfo, gboolean create) { - /* Get or create conversation and DICOM data structure if desired - Return new or existing dicom structure, which is used to store context IDs and xfer Syntax - Return NULL in case of the structure couldn't be created + /* Get or create conversation and DICOM data structure if desired + Return new or existing dicom structure, which is used to store context IDs and xfer Syntax + Return NULL in case of the structure couldn't be created */ conversation_t *conv=NULL; - dcm_state_t *dcm_data=NULL; + dcm_state_t *dcm_data=NULL; conv = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, - pinfo->ptype, pinfo->srcport, pinfo->destport, 0); + pinfo->ptype, pinfo->srcport, pinfo->destport, 0); if (conv == NULL) { - /* Conversation does not exist, create one. - Usually set for the first packet already. Probably by dissect-tcp - */ - conv = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, - pinfo->srcport, pinfo->destport, 0); + /* Conversation does not exist, create one. + Usually set for the first packet already. Probably by dissect-tcp + */ + conv = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, + pinfo->srcport, pinfo->destport, 0); } - else { /* conversation exists, try to get data already filled */ - dcm_data = (dcm_state_t *)conversation_get_proto_data(conv, proto_dcm); + else { /* conversation exists, try to get data already filled */ + dcm_data = (dcm_state_t *)conversation_get_proto_data(conv, proto_dcm); } if (dcm_data == NULL && create) { - dcm_data = dcm_state_new(); + dcm_data = dcm_state_new(); conversation_add_proto_data(conv, proto_dcm, dcm_data); - /* Mark it as DICOM conversation. Needed for the heuristic mode, - to prevent stealing subsequent packets by other dissectors - */ - conversation_set_dissector(conv, dcm_handle); + /* Mark it as DICOM conversation. Needed for the heuristic mode, + to prevent stealing subsequent packets by other dissectors + */ + conversation_set_dissector(conv, dcm_handle); } return dcm_data; @@ -4057,7 +4057,7 @@ dcm_state_assoc_new(dcm_state_t *dcm_data, guint32 packet_no) dcm_state_assoc_t *assoc; assoc = (dcm_state_assoc_t *) wmem_alloc0(wmem_file_scope(), sizeof(dcm_state_assoc_t)); - assoc->packet_no = packet_no; /* Identifier */ + assoc->packet_no = packet_no; /* Identifier */ /* add to the end of the list */ if (dcm_data->last_assoc) { @@ -4084,21 +4084,21 @@ dcm_state_assoc_get(dcm_state_t *dcm_data, guint32 packet_no, gboolean create) while (assoc) { - if (assoc->next) { - /* we have more associations in the same stream */ - if ((assoc->packet_no <= packet_no) && (packet_no < assoc->next->packet_no)) - break; - } - else { - /* last or only associations in the same stream */ - if (assoc->packet_no <= packet_no) - break; - } - assoc = assoc->next; + if (assoc->next) { + /* we have more associations in the same stream */ + if ((assoc->packet_no <= packet_no) && (packet_no < assoc->next->packet_no)) + break; + } + else { + /* last or only associations in the same stream */ + if (assoc->packet_no <= packet_no) + break; + } + assoc = assoc->next; } if (assoc == NULL && create) { - assoc = dcm_state_assoc_new(dcm_data, packet_no); + assoc = dcm_state_assoc_new(dcm_data, packet_no); } return assoc; } @@ -4140,13 +4140,13 @@ dcm_state_pctx_get(dcm_state_assoc_t *assoc, guint8 pctx_id, gboolean create) static dcm_state_pctx_t dunk = { NULL, NULL, FALSE, 0, notfound, notfound, notfound, notfound, DCM_UNK }; */ while (pctx) { - if (pctx->id == pctx_id) - break; - pctx = pctx->next; + if (pctx->id == pctx_id) + break; + pctx = pctx->next; } if (pctx == NULL && create) { - pctx = dcm_state_pctx_new(assoc, pctx_id); + pctx = dcm_state_pctx_new(assoc, pctx_id); } return pctx; @@ -4162,7 +4162,7 @@ dcm_state_pdv_new(dcm_state_pctx_t *pctx, guint32 packet_no, guint32 offset) pdv = (dcm_state_pdv_t *) wmem_alloc0(wmem_file_scope(), sizeof(dcm_state_pdv_t)); pdv->syntax = DCM_UNK; - pdv->is_last_fragment = TRUE; /* Continuation PDVs are more tricky */ + pdv->is_last_fragment = TRUE; /* Continuation PDVs are more tricky */ pdv->packet_no = packet_no; pdv->offset = offset; @@ -4189,13 +4189,13 @@ dcm_state_pdv_get(dcm_state_pctx_t *pctx, guint32 packet_no, guint32 offset, gbo pdv=pctx->first_pdv; while (pdv) { - if ((pdv->packet_no == packet_no) && (pdv->offset == offset)) - break; - pdv = pdv->next; + if ((pdv->packet_no == packet_no) && (pdv->offset == offset)) + break; + pdv = pdv->next; } if (pdv == NULL && create) { - pdv = dcm_state_pdv_new(pctx, packet_no, offset); + pdv = dcm_state_pdv_new(pctx, packet_no, offset); } return pdv; } @@ -4208,7 +4208,7 @@ dcm_state_pdv_get_obj_start(dcm_state_pdv_t *pdv_curr) /* Get First PDV of the DICOM Object */ while (pdv_first->prev && !pdv_first->prev->is_last_fragment) { - pdv_first = pdv_first->prev; + pdv_first = pdv_first->prev; } return pdv_first; @@ -4275,39 +4275,39 @@ dcm_rsp2str(guint16 status_value) const gchar *s = ""; /* - Classification - 0x0000 : SUCCESS - 0x0001 & Bxxx : WARNING - 0xFE00 : CANCEL - 0XFFxx : PENDING + Classification + 0x0000 : SUCCESS + 0x0001 & Bxxx : WARNING + 0xFE00 : CANCEL + 0XFFxx : PENDING - All other : FAILURE + All other : FAILURE */ /* Use specific text first */ status = (dcm_status_t*) g_hash_table_lookup(dcm_status_table, GUINT_TO_POINTER((guint32)status_value)); if (status) { - s = status->description; + s = status->description; } else { - if ((status_value & 0xFF00) == 0xA700) { - /* 0xA7xx */ - s = "Refused: Out of Resources"; - } - else if ((status_value & 0xFF00) == 0xA900) { - /* 0xA9xx */ - s = "Error: Data Set does not match SOP Class"; - } - else if ((status_value & 0xF000) == 0xC000) { - /* 0xCxxx */ - s = "Error: Cannot understand/Unable to Process"; - } - else { - /* At least came across 0xD001 in one capture */ - s = "Unknown"; - } + if ((status_value & 0xFF00) == 0xA700) { + /* 0xA7xx */ + s = "Refused: Out of Resources"; + } + else if ((status_value & 0xFF00) == 0xA900) { + /* 0xA9xx */ + s = "Error: Data Set does not match SOP Class"; + } + else if ((status_value & 0xF000) == 0xC000) { + /* 0xCxxx */ + s = "Error: Cannot understand/Unable to Process"; + } + else { + /* At least came across 0xD001 in one capture */ + s = "Unknown"; + } } return s; @@ -4325,10 +4325,10 @@ static void dcm_set_syntax(dcm_state_pctx_t *pctx, gchar *xfer_uid, const gchar *xfer_desc) { if ((pctx == NULL) || (xfer_uid == NULL) || (xfer_desc == NULL)) - return; + return; - g_free(pctx->xfer_uid); /* free prev allocated xfer */ - g_free(pctx->xfer_desc); /* free prev allocated xfer */ + g_free(pctx->xfer_uid); /* free prev allocated xfer */ + g_free(pctx->xfer_desc); /* free prev allocated xfer */ pctx->syntax = 0; pctx->xfer_uid = g_strdup(xfer_uid); @@ -4338,19 +4338,19 @@ dcm_set_syntax(dcm_state_pctx_t *pctx, gchar *xfer_uid, const gchar *xfer_desc) * find the syntax. * Absent of coding that, this is in descending order of probability */ if (0 == strcmp(xfer_uid, "1.2.840.10008.1.2")) - pctx->syntax = DCM_ILE; /* implicit little endian */ + pctx->syntax = DCM_ILE; /* implicit little endian */ else if (0 == strcmp(xfer_uid, "1.2.840.10008.1.2.1")) - pctx->syntax = DCM_ELE; /* explicit little endian */ + pctx->syntax = DCM_ELE; /* explicit little endian */ else if (0 == strcmp(xfer_uid, "1.2.840.10008.1.2.2")) - pctx->syntax = DCM_EBE; /* explicit big endian */ + pctx->syntax = DCM_EBE; /* explicit big endian */ else if (0 == strcmp(xfer_uid, "1.2.840.113619.5.2")) - pctx->syntax = DCM_ILE; /* implicit little endian, big endian pixels, GE private */ + pctx->syntax = DCM_ILE; /* implicit little endian, big endian pixels, GE private */ else if (0 == strcmp(xfer_uid, "1.2.840.10008.1.2.4.70")) - pctx->syntax = DCM_ELE; /* explicit little endian, jpeg */ + pctx->syntax = DCM_ELE; /* explicit little endian, jpeg */ else if (0 == strncmp(xfer_uid, "1.2.840.10008.1.2.4", 18)) - pctx->syntax = DCM_ELE; /* explicit little endian, jpeg */ + pctx->syntax = DCM_ELE; /* explicit little endian, jpeg */ else if (0 == strcmp(xfer_uid, "1.2.840.10008.1.2.1.99")) - pctx->syntax = DCM_ELE; /* explicit little endian, deflated */ + pctx->syntax = DCM_ELE; /* explicit little endian, deflated */ } static void @@ -4374,12 +4374,12 @@ dcm_guint32_to_le(guint8 *buffer, guint32 value) static guint32 dcm_export_create_tag_base(guint8 *buffer, guint32 bufflen, guint32 offset, - guint16 grp, guint16 elm, guint16 vr, - const guint8 *value_buffer, guint32 value_len) + guint16 grp, guint16 elm, guint16 vr, + const guint8 *value_buffer, guint32 value_len) { /* Only Explicit Little Endian is needed to create Metafile Header - Generic function to write a TAG, VR, LEN & VALUE to a combined buffer - The value (buffer, len) must be preprocessed by a VR specific function + Generic function to write a TAG, VR, LEN & VALUE to a combined buffer + The value (buffer, len) must be preprocessed by a VR specific function */ if (offset + 6 > bufflen) return bufflen; @@ -4398,26 +4398,26 @@ dcm_export_create_tag_base(guint8 *buffer, guint32 bufflen, guint32 offset, case DCM_VR_SQ: case DCM_VR_UT: case DCM_VR_UN: - /* DICOM likes it complicated. Special handling for these types */ + /* DICOM likes it complicated. Special handling for these types */ if (offset + 6 > bufflen) return bufflen; - /* Add two reserved 0x00 bytes */ - dcm_guint16_to_le(buffer + offset, 0); - offset += 2; + /* Add two reserved 0x00 bytes */ + dcm_guint16_to_le(buffer + offset, 0); + offset += 2; - /* Length is a 4 byte field */ + /* Length is a 4 byte field */ dcm_guint32_to_le(buffer + offset, value_len); - offset += 4; + offset += 4; - break; + break; default: - /* Length is a 2 byte field */ + /* Length is a 2 byte field */ if (offset + 2 > bufflen) return bufflen; dcm_guint16_to_le(buffer + offset, (guint16)value_len); - offset += 2; + offset += 2; } if (offset + value_len > bufflen) return bufflen; @@ -4430,7 +4430,7 @@ dcm_export_create_tag_base(guint8 *buffer, guint32 bufflen, guint32 offset, static guint32 dcm_export_create_tag_guint16(guint8 *buffer, guint32 bufflen, guint32 offset, - guint16 grp, guint16 elm, guint16 vr, guint16 value) + guint16 grp, guint16 elm, guint16 vr, guint16 value) { return dcm_export_create_tag_base(buffer, bufflen, offset, grp, elm, vr, (guint8*)&value, 2); @@ -4438,7 +4438,7 @@ dcm_export_create_tag_guint16(guint8 *buffer, guint32 bufflen, guint32 offset, static guint32 dcm_export_create_tag_guint32(guint8 *buffer, guint32 bufflen, guint32 offset, - guint16 grp, guint16 elm, guint16 vr, guint32 value) + guint16 grp, guint16 elm, guint16 vr, guint32 value) { return dcm_export_create_tag_base(buffer, bufflen, offset, grp, elm, vr, (guint8*)&value, 4); @@ -4446,21 +4446,21 @@ dcm_export_create_tag_guint32(guint8 *buffer, guint32 bufflen, guint32 offset, static guint32 dcm_export_create_tag_str(guint8 *buffer, guint32 bufflen, guint32 offset, - guint16 grp, guint16 elm, guint16 vr, - const gchar *value) + guint16 grp, guint16 elm, guint16 vr, + const gchar *value) { guint32 len; if (!value) { - /* NULL object. E.g. happens if UID was not found/set. Don't create element*/ - return offset; + /* NULL object. E.g. happens if UID was not found/set. Don't create element*/ + return offset; } len=(int)strlen(value); if ((len & 0x01) == 1) { - /* Odd length: since buffer is 0 initialized, pad with a 0x00 */ - len += 1; + /* Odd length: since buffer is 0 initialized, pad with a 0x00 */ + len += 1; } return dcm_export_create_tag_base(buffer, bufflen, offset, grp, elm, vr, (const guint8 *)value, len); @@ -4470,54 +4470,54 @@ dcm_export_create_tag_str(guint8 *buffer, guint32 bufflen, guint32 offset, static guint8* dcm_export_create_header(guint32 *dcm_header_len, const gchar *sop_class_uid, gchar *sop_instance_uid, gchar *xfer_uid) { - guint8 *dcm_header=NULL; - guint32 offset=0; - guint32 offset_header_len=0; + guint8 *dcm_header=NULL; + guint32 offset=0; + guint32 offset_header_len=0; #define DCM_HEADER_MAX 512 dcm_header=(guint8 *)wmem_alloc0(wmem_packet_scope(), DCM_HEADER_MAX); /* Slightly longer than needed */ - /* The subsequent functions rely on a 0 initialized buffer */ + /* The subsequent functions rely on a 0 initialized buffer */ offset=128; memmove(dcm_header+offset, "DICM", 4); offset+=4; - offset_header_len=offset; /* remember for later */ + offset_header_len=offset; /* remember for later */ offset+=12; /* - (0002,0000) File Meta Information Group Length UL - (0002,0001) File Meta Information Version OB - (0002,0002) Media Storage SOP Class UID UI - (0002,0003) Media Storage SOP Instance UID UI - (0002,0010) Transfer Syntax UID UI - (0002,0012) Implementation Class UID UI - (0002,0013) Implementation Version Name SH + (0002,0000) File Meta Information Group Length UL + (0002,0001) File Meta Information Version OB + (0002,0002) Media Storage SOP Class UID UI + (0002,0003) Media Storage SOP Instance UID UI + (0002,0010) Transfer Syntax UID UI + (0002,0012) Implementation Class UID UI + (0002,0013) Implementation Version Name SH */ offset=dcm_export_create_tag_guint16(dcm_header, DCM_HEADER_MAX, offset, - 0x0002, 0x0001, DCM_VR_OB, 0x0100); /* will result on 00 01 since it is little endian */ + 0x0002, 0x0001, DCM_VR_OB, 0x0100); /* will result on 00 01 since it is little endian */ offset=dcm_export_create_tag_str(dcm_header, DCM_HEADER_MAX, offset, - 0x0002, 0x0002, DCM_VR_UI, sop_class_uid); + 0x0002, 0x0002, DCM_VR_UI, sop_class_uid); offset=dcm_export_create_tag_str(dcm_header, DCM_HEADER_MAX, offset, - 0x0002, 0x0003, DCM_VR_UI, sop_instance_uid); + 0x0002, 0x0003, DCM_VR_UI, sop_instance_uid); offset=dcm_export_create_tag_str(dcm_header, DCM_HEADER_MAX, offset, - 0x0002, 0x0010, DCM_VR_UI, xfer_uid); + 0x0002, 0x0010, DCM_VR_UI, xfer_uid); offset=dcm_export_create_tag_str(dcm_header, DCM_HEADER_MAX, offset, - 0x0002, 0x0012, DCM_VR_UI, WIRESHARK_IMPLEMENTATION_UID); + 0x0002, 0x0012, DCM_VR_UI, WIRESHARK_IMPLEMENTATION_UID); offset=dcm_export_create_tag_str(dcm_header, DCM_HEADER_MAX, offset, - 0x0002, 0x0013, DCM_VR_SH, WIRESHARK_IMPLEMENTATION_VERSION); + 0x0002, 0x0013, DCM_VR_SH, WIRESHARK_IMPLEMENTATION_VERSION); /* Finally write the meta header length */ dcm_export_create_tag_guint32(dcm_header, DCM_HEADER_MAX, offset_header_len, - 0x0002, 0x0000, DCM_VR_UL, offset-offset_header_len-12); + 0x0002, 0x0000, DCM_VR_UL, offset-offset_header_len-12); *dcm_header_len=offset; @@ -4541,23 +4541,23 @@ dcm_export_create_object(packet_info *pinfo, dcm_state_assoc_t *assoc, dcm_state its predecessors will zero data. */ - dicom_eo_t *eo_info = NULL; + dicom_eo_t *eo_info = NULL; - dcm_state_pdv_t *pdv_curr = NULL; - dcm_state_pdv_t *pdv_same_pkt = NULL; - dcm_state_pctx_t *pctx = NULL; + dcm_state_pdv_t *pdv_curr = NULL; + dcm_state_pdv_t *pdv_same_pkt = NULL; + dcm_state_pctx_t *pctx = NULL; guint8 *pdv_combined = NULL; guint8 *pdv_combined_curr = NULL; guint8 *dcm_header = NULL; - guint32 pdv_combined_len = 0; - guint32 dcm_header_len = 0; - guint16 cnt_same_pkt = 1; + guint32 pdv_combined_len = 0; + guint32 dcm_header_len = 0; + guint16 cnt_same_pkt = 1; gchar *filename; const gchar *hostname; - const gchar *sop_class_uid; - gchar *sop_instance_uid; + const gchar *sop_class_uid; + gchar *sop_instance_uid; /* Calculate total PDV length, i.e. all packets until last PDV without continuation */ pdv_curr = pdv; @@ -4565,121 +4565,121 @@ dcm_export_create_object(packet_info *pinfo, dcm_state_assoc_t *assoc, dcm_state pdv_combined_len=pdv_curr->data_len; while (pdv_curr->prev && !pdv_curr->prev->is_last_fragment) { - pdv_curr = pdv_curr->prev; - pdv_combined_len += pdv_curr->data_len; + pdv_curr = pdv_curr->prev; + pdv_combined_len += pdv_curr->data_len; } /* Count number of PDVs with the same Packet Number */ while (pdv_same_pkt->prev && (pdv_same_pkt->prev->packet_no == pdv_same_pkt->packet_no)) { - pdv_same_pkt = pdv_same_pkt->prev; - cnt_same_pkt += 1; + pdv_same_pkt = pdv_same_pkt->prev; + cnt_same_pkt += 1; } pctx=dcm_state_pctx_get(assoc, pdv_curr->pctx_id, FALSE); if (strlen(assoc->ae_calling)>0 && strlen(assoc->ae_called)>0 ) { - hostname = wmem_strdup_printf(wmem_packet_scope(), "%s <-> %s", assoc->ae_calling, assoc->ae_called); + hostname = wmem_strdup_printf(wmem_packet_scope(), "%s <-> %s", assoc->ae_calling, assoc->ae_called); } else { - hostname = "AE title(s) unknown"; + hostname = "AE title(s) unknown"; } if (pdv->is_storage && - pdv_curr->sop_class_uid && strlen(pdv_curr->sop_class_uid)>0 && - pdv_curr->sop_instance_uid && strlen(pdv_curr->sop_instance_uid)>0) { - - sop_class_uid = wmem_strndup(wmem_packet_scope(), pdv_curr->sop_class_uid, MAX_BUF_LEN); - sop_instance_uid = wmem_strndup(wmem_packet_scope(), pdv_curr->sop_instance_uid, MAX_BUF_LEN); - - /* Make sure filename does not contain invalid character. Rather conservative. - Even though this should be a valid DICOM UID, apply the same filter rules - in case of bogus data. - */ - filename = wmem_strdup_printf(wmem_packet_scope(), "%06d-%d-%s.dcm", pinfo->fd->num, cnt_same_pkt, - g_strcanon(pdv_curr->sop_instance_uid, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-.", '-')); + pdv_curr->sop_class_uid && strlen(pdv_curr->sop_class_uid)>0 && + pdv_curr->sop_instance_uid && strlen(pdv_curr->sop_instance_uid)>0) { + + sop_class_uid = wmem_strndup(wmem_packet_scope(), pdv_curr->sop_class_uid, MAX_BUF_LEN); + sop_instance_uid = wmem_strndup(wmem_packet_scope(), pdv_curr->sop_instance_uid, MAX_BUF_LEN); + + /* Make sure filename does not contain invalid character. Rather conservative. + Even though this should be a valid DICOM UID, apply the same filter rules + in case of bogus data. + */ + filename = wmem_strdup_printf(wmem_packet_scope(), "%06d-%d-%s.dcm", pinfo->fd->num, cnt_same_pkt, + g_strcanon(pdv_curr->sop_instance_uid, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-.", '-')); } else { - /* No SOP Instance or SOP Class UID found in PDV. Use wireshark ones */ + /* No SOP Instance or SOP Class UID found in PDV. Use wireshark ones */ - sop_class_uid = wmem_strdup(wmem_packet_scope(), WIRESHARK_MEDIA_STORAGE_SOP_CLASS_UID); - sop_instance_uid = wmem_strdup_printf(wmem_packet_scope(), "%s.%d.%d", - WIRESHARK_MEDIA_STORAGE_SOP_INSTANCE_UID_PREFIX, pinfo->fd->num, cnt_same_pkt); + sop_class_uid = wmem_strdup(wmem_packet_scope(), WIRESHARK_MEDIA_STORAGE_SOP_CLASS_UID); + sop_instance_uid = wmem_strdup_printf(wmem_packet_scope(), "%s.%d.%d", + WIRESHARK_MEDIA_STORAGE_SOP_INSTANCE_UID_PREFIX, pinfo->fd->num, cnt_same_pkt); - /* Make sure filename does not contain invalid character. Rather conservative.*/ - filename = wmem_strdup_printf(wmem_packet_scope(), "%06d-%d-%s.dcm", pinfo->fd->num, cnt_same_pkt, - g_strcanon(pdv->desc, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-.", '-')); + /* Make sure filename does not contain invalid character. Rather conservative.*/ + filename = wmem_strdup_printf(wmem_packet_scope(), "%06d-%d-%s.dcm", pinfo->fd->num, cnt_same_pkt, + g_strcanon(pdv->desc, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-.", '-')); } if (global_dcm_export_header) { - if (pctx && pctx->xfer_uid && strlen(pctx->xfer_uid)>0) { - dcm_header=dcm_export_create_header(&dcm_header_len, sop_class_uid, sop_instance_uid, pctx->xfer_uid); - } - else { - /* We are running blind, i.e. no presentation context/syntax found. - Don't invent one, so the meta header will miss - the transfer syntax UID tag (even though it is mandatory) - */ - dcm_header=dcm_export_create_header(&dcm_header_len, sop_class_uid, sop_instance_uid, NULL); - } + if (pctx && pctx->xfer_uid && strlen(pctx->xfer_uid)>0) { + dcm_header=dcm_export_create_header(&dcm_header_len, sop_class_uid, sop_instance_uid, pctx->xfer_uid); + } + else { + /* We are running blind, i.e. no presentation context/syntax found. + Don't invent one, so the meta header will miss + the transfer syntax UID tag (even though it is mandatory) + */ + dcm_header=dcm_export_create_header(&dcm_header_len, sop_class_uid, sop_instance_uid, NULL); + } } if (dcm_header_len + pdv_combined_len >= global_dcm_export_minsize) { - /* Allocate the final size */ + /* Allocate the final size */ - /* The complete eo_info structure and its elements will be freed in - export_object.c -> eo_win_destroy_cb() using g_free() - */ + /* The complete eo_info structure and its elements will be freed in + export_object.c -> eo_win_destroy_cb() using g_free() + */ - pdv_combined = (guint8 *)g_malloc0(dcm_header_len + pdv_combined_len); + pdv_combined = (guint8 *)g_malloc0(dcm_header_len + pdv_combined_len); - pdv_combined_curr = pdv_combined; + pdv_combined_curr = pdv_combined; - if (dcm_header_len != 0) { /* Will be 0 when global_dcm_export_header is FALSE */ - memmove(pdv_combined, dcm_header, dcm_header_len); - pdv_combined_curr += dcm_header_len; - } + if (dcm_header_len != 0) { /* Will be 0 when global_dcm_export_header is FALSE */ + memmove(pdv_combined, dcm_header, dcm_header_len); + pdv_combined_curr += dcm_header_len; + } - /* Copy PDV per PDV to target buffer */ - while (!pdv_curr->is_last_fragment) { - memmove(pdv_combined_curr, pdv_curr->data, pdv_curr->data_len); /* this is a copy not move */ - g_free(pdv_curr->data); - pdv_combined_curr += pdv_curr->data_len; - pdv_curr = pdv_curr->next; - } + /* Copy PDV per PDV to target buffer */ + while (!pdv_curr->is_last_fragment) { + memmove(pdv_combined_curr, pdv_curr->data, pdv_curr->data_len); /* this is a copy not move */ + g_free(pdv_curr->data); + pdv_combined_curr += pdv_curr->data_len; + pdv_curr = pdv_curr->next; + } - /* Last packet */ - memmove(pdv_combined_curr, pdv->data, pdv->data_len); /* this is a copy not a move */ - g_free(pdv_curr->data); + /* Last packet */ + memmove(pdv_combined_curr, pdv->data, pdv->data_len); /* this is a copy not a move */ + g_free(pdv_curr->data); - /* Add to list */ - eo_info = (dicom_eo_t *)g_malloc0(sizeof(dicom_eo_t)); - eo_info->hostname = g_strdup(hostname); - eo_info->filename = g_strdup(filename); - eo_info->content_type = g_strdup(pdv->desc); + /* Add to list */ + eo_info = (dicom_eo_t *)g_malloc0(sizeof(dicom_eo_t)); + eo_info->hostname = g_strdup(hostname); + eo_info->filename = g_strdup(filename); + eo_info->content_type = g_strdup(pdv->desc); - eo_info->payload_data = pdv_combined; - eo_info->payload_len = dcm_header_len + pdv_combined_len; + eo_info->payload_data = pdv_combined; + eo_info->payload_len = dcm_header_len + pdv_combined_len; - tap_queue_packet(dicom_eo_tap, pinfo, eo_info); + tap_queue_packet(dicom_eo_tap, pinfo, eo_info); } } static guint32 dissect_dcm_assoc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, dcm_state_assoc_t *assoc, - guint8 pdu_type, guint32 pdu_len) + guint8 pdu_type, guint32 pdu_len) { /* - * Decode association header + * Decode association header */ proto_item *assoc_header_pitem; - proto_tree *assoc_header_ptree; /* Tree for item details */ + proto_tree *assoc_header_ptree; /* Tree for item details */ guint16 assoc_ver; - const gchar *buf_desc = NULL; + const gchar *buf_desc = NULL; const char *reject_result_desc = ""; const char *reject_source_desc = ""; const char *reject_reason_desc = ""; @@ -4695,187 +4695,187 @@ dissect_dcm_assoc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu assoc_header_ptree = proto_tree_add_subtree(tree, tvb, offset, pdu_len, ett_assoc_header, &assoc_header_pitem, "Association Header"); switch (pdu_type) { - case 1: /* Association Request */ - - assoc_ver = tvb_get_ntohs(tvb, offset); - proto_tree_add_uint(assoc_header_ptree, hf_dcm_assoc_version, tvb, offset, 2, assoc_ver); - offset += 2; - - offset += 2; /* Two reserved bytes*/ - - tvb_memcpy(tvb, assoc->ae_called, offset, 16); - assoc->ae_called[AEEND] = 0; - proto_tree_add_string(assoc_header_ptree, hf_dcm_assoc_called, tvb, offset, 16, assoc->ae_called); - offset += 16; - - tvb_memcpy(tvb, assoc->ae_calling, offset, 16); - assoc->ae_calling[AEEND] = 0; - proto_tree_add_string(assoc_header_ptree, hf_dcm_assoc_calling, tvb, offset, 16, assoc->ae_calling); - offset += 16; + case 1: /* Association Request */ + + assoc_ver = tvb_get_ntohs(tvb, offset); + proto_tree_add_uint(assoc_header_ptree, hf_dcm_assoc_version, tvb, offset, 2, assoc_ver); + offset += 2; + + offset += 2; /* Two reserved bytes*/ + + tvb_memcpy(tvb, assoc->ae_called, offset, 16); + assoc->ae_called[AEEND] = 0; + proto_tree_add_string(assoc_header_ptree, hf_dcm_assoc_called, tvb, offset, 16, assoc->ae_called); + offset += 16; + + tvb_memcpy(tvb, assoc->ae_calling, offset, 16); + assoc->ae_calling[AEEND] = 0; + proto_tree_add_string(assoc_header_ptree, hf_dcm_assoc_calling, tvb, offset, 16, assoc->ae_calling); + offset += 16; + + offset += 32; /* 32 reserved bytes */ + + buf_desc = wmem_strdup_printf(wmem_packet_scope(), "A-ASSOCIATE request %s --> %s", + g_strstrip(assoc->ae_calling), g_strstrip(assoc->ae_called)); + + offset = dissect_dcm_assoc_detail(tvb, pinfo, assoc_header_ptree, assoc, + offset, pdu_len-offset); + + break; + case 2: /* Association Accept */ + + assoc_ver = tvb_get_ntohs(tvb, offset+2); + proto_tree_add_uint(assoc_header_ptree, hf_dcm_assoc_version, tvb, offset, 2, assoc_ver); + offset += 2; + + offset += 2; /* Two reserved bytes*/ + + tvb_memcpy(tvb, assoc->ae_called_resp, offset, 16); + assoc->ae_called_resp[AEEND] = 0; + proto_tree_add_string(assoc_header_ptree, hf_dcm_assoc_called, tvb, offset, 16, assoc->ae_called_resp); + offset += 16; + + tvb_memcpy(tvb, assoc->ae_calling_resp, offset, 16); + assoc->ae_calling_resp[AEEND] = 0; + proto_tree_add_string(assoc_header_ptree, hf_dcm_assoc_calling, tvb, offset, 16, assoc->ae_calling_resp); + offset += 16; + + offset += 32; /* 32 reserved bytes */ + + buf_desc = wmem_strdup_printf(wmem_packet_scope(), "A-ASSOCIATE accept %s <-- %s", + g_strstrip(assoc->ae_calling_resp), g_strstrip(assoc->ae_called_resp)); - offset += 32; /* 32 reserved bytes */ + offset = dissect_dcm_assoc_detail(tvb, pinfo, assoc_header_ptree, assoc, + offset, pdu_len-offset); - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "A-ASSOCIATE request %s --> %s", - g_strstrip(assoc->ae_calling), g_strstrip(assoc->ae_called)); + break; + case 3: /* Association Reject */ - offset = dissect_dcm_assoc_detail(tvb, pinfo, assoc_header_ptree, assoc, - offset, pdu_len-offset); + offset += 1; /* One reserved byte */ - break; - case 2: /* Association Accept */ + reject_result = tvb_get_guint8(tvb, offset); + reject_source = tvb_get_guint8(tvb, offset+1); + reject_reason = tvb_get_guint8(tvb, offset+2); - assoc_ver = tvb_get_ntohs(tvb, offset+2); - proto_tree_add_uint(assoc_header_ptree, hf_dcm_assoc_version, tvb, offset, 2, assoc_ver); - offset += 2; + switch (reject_result) { + case 1: reject_result_desc = "Reject Permanent"; break; + case 2: reject_result_desc = "Reject Transient"; break; + default: break; + } + + switch (reject_source) { + case 1: + reject_source_desc = "User"; + switch (reject_reason) { + case 1: reject_reason_desc = "No reason given"; break; + case 2: reject_reason_desc = "Application context name not supported"; break; + case 3: reject_reason_desc = "Calling AE title not recognized"; break; + case 7: reject_reason_desc = "Called AE title not recognized"; break; + } + break; + case 2: + reject_source_desc = "Provider (ACSE)"; + switch (reject_reason) { + case 1: reject_reason_desc = "No reason given"; break; + case 2: reject_reason_desc = "Protocol version not supported"; break; + } + break; + case 3: + reject_source_desc = "Provider (Presentation)"; + switch (reject_reason) { + case 1: reject_reason_desc = "Temporary congestion"; break; + case 2: reject_reason_desc = "Local limit exceeded"; break; + } + break; + } + + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_reject_result, tvb, + offset , 1, reject_result, "%s", reject_result_desc); + + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_reject_source, tvb, + offset+1, 1, reject_source, "%s", reject_source_desc); + + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_reject_reason, tvb, + offset+2, 1, reject_reason, "%s", reject_reason_desc); + + offset += 3; + + /* Provider aborted */ + buf_desc = wmem_strdup_printf(wmem_packet_scope(), "A-ASSOCIATE reject %s <-- %s (%s)", + g_strstrip(assoc->ae_calling), g_strstrip(assoc->ae_called), reject_reason_desc); + + expert_add_info(pinfo, assoc_header_pitem, &ei_dcm_assoc_rejected); + + break; + case 5: /* RELEASE Request */ + + offset += 2; /* Two reserved bytes */ + buf_desc="A-RELEASE request"; + + break; + case 6: /* RELEASE Response */ + + offset += 2; /* Two reserved bytes */ + buf_desc="A-RELEASE response"; + + break; + case 7: /* ABORT */ - offset += 2; /* Two reserved bytes*/ + offset += 2; /* Two reserved bytes */ - tvb_memcpy(tvb, assoc->ae_called_resp, offset, 16); - assoc->ae_called_resp[AEEND] = 0; - proto_tree_add_string(assoc_header_ptree, hf_dcm_assoc_called, tvb, offset, 16, assoc->ae_called_resp); - offset += 16; - - tvb_memcpy(tvb, assoc->ae_calling_resp, offset, 16); - assoc->ae_calling_resp[AEEND] = 0; - proto_tree_add_string(assoc_header_ptree, hf_dcm_assoc_calling, tvb, offset, 16, assoc->ae_calling_resp); - offset += 16; - - offset += 32; /* 32 reserved bytes */ - - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "A-ASSOCIATE accept %s <-- %s", - g_strstrip(assoc->ae_calling_resp), g_strstrip(assoc->ae_called_resp)); - - offset = dissect_dcm_assoc_detail(tvb, pinfo, assoc_header_ptree, assoc, - offset, pdu_len-offset); - - break; - case 3: /* Association Reject */ - - offset += 1; /* One reserved byte */ - - reject_result = tvb_get_guint8(tvb, offset); - reject_source = tvb_get_guint8(tvb, offset+1); - reject_reason = tvb_get_guint8(tvb, offset+2); - - switch (reject_result) { - case 1: reject_result_desc = "Reject Permanent"; break; - case 2: reject_result_desc = "Reject Transient"; break; - default: break; - } - - switch (reject_source) { - case 1: - reject_source_desc = "User"; - switch (reject_reason) { - case 1: reject_reason_desc = "No reason given"; break; - case 2: reject_reason_desc = "Application context name not supported"; break; - case 3: reject_reason_desc = "Calling AE title not recognized"; break; - case 7: reject_reason_desc = "Called AE title not recognized"; break; - } - break; - case 2: - reject_source_desc = "Provider (ACSE)"; - switch (reject_reason) { - case 1: reject_reason_desc = "No reason given"; break; - case 2: reject_reason_desc = "Protocol version not supported"; break; - } - break; - case 3: - reject_source_desc = "Provider (Presentation)"; - switch (reject_reason) { - case 1: reject_reason_desc = "Temporary congestion"; break; - case 2: reject_reason_desc = "Local limit exceeded"; break; - } - break; - } - - proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_reject_result, tvb, - offset , 1, reject_result, "%s", reject_result_desc); - - proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_reject_source, tvb, - offset+1, 1, reject_source, "%s", reject_source_desc); - - proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_reject_reason, tvb, - offset+2, 1, reject_reason, "%s", reject_reason_desc); - - offset += 3; - - /* Provider aborted */ - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "A-ASSOCIATE reject %s <-- %s (%s)", - g_strstrip(assoc->ae_calling), g_strstrip(assoc->ae_called), reject_reason_desc); - - expert_add_info(pinfo, assoc_header_pitem, &ei_dcm_assoc_rejected); - - break; - case 5: /* RELEASE Request */ - - offset += 2; /* Two reserved bytes */ - buf_desc="A-RELEASE request"; - - break; - case 6: /* RELEASE Response */ - - offset += 2; /* Two reserved bytes */ - buf_desc="A-RELEASE response"; - - break; - case 7: /* ABORT */ - - offset += 2; /* Two reserved bytes */ - - abort_source = tvb_get_guint8(tvb, offset); - abort_reason = tvb_get_guint8(tvb, offset+1); - - switch (abort_source) { - case 0: - abort_source_desc = "User"; - abort_reason_desc = "N/A"; /* No details can be provided*/ - break; - case 1: - /* reserved */ - break; - case 2: - abort_source_desc = "Provider"; - - switch (abort_reason) { - case 0: abort_reason_desc = "Not specified"; break; - case 1: abort_reason_desc = "Unrecognized PDU"; break; - case 2: abort_reason_desc = "Unexpected PDU"; break; - case 4: abort_reason_desc = "Unrecognized PDU parameter"; break; - case 5: abort_reason_desc = "Unexpected PDU parameter"; break; - case 6: abort_reason_desc = "Invalid PDU parameter value"; break; - } - - break; - } - - proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_abort_source, - tvb, offset , 1, abort_source, "%s", abort_source_desc); - - proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_abort_reason, - tvb, offset+1, 1, abort_reason, "%s", abort_reason_desc); - offset += 2; - - if (abort_source == 0) { - /* User aborted */ - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "ABORT %s --> %s", - g_strstrip(assoc->ae_calling), g_strstrip(assoc->ae_called)); - } - else { - /* Provider aborted, slightly more information */ - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "ABORT %s <-- %s (%s)", - g_strstrip(assoc->ae_calling), g_strstrip(assoc->ae_called), abort_reason_desc); - } - - expert_add_info(pinfo, assoc_header_pitem, &ei_dcm_assoc_aborted); - - break; + abort_source = tvb_get_guint8(tvb, offset); + abort_reason = tvb_get_guint8(tvb, offset+1); + + switch (abort_source) { + case 0: + abort_source_desc = "User"; + abort_reason_desc = "N/A"; /* No details can be provided*/ + break; + case 1: + /* reserved */ + break; + case 2: + abort_source_desc = "Provider"; + + switch (abort_reason) { + case 0: abort_reason_desc = "Not specified"; break; + case 1: abort_reason_desc = "Unrecognized PDU"; break; + case 2: abort_reason_desc = "Unexpected PDU"; break; + case 4: abort_reason_desc = "Unrecognized PDU parameter"; break; + case 5: abort_reason_desc = "Unexpected PDU parameter"; break; + case 6: abort_reason_desc = "Invalid PDU parameter value"; break; + } + + break; + } + + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_abort_source, + tvb, offset , 1, abort_source, "%s", abort_source_desc); + + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_abort_reason, + tvb, offset+1, 1, abort_reason, "%s", abort_reason_desc); + offset += 2; + + if (abort_source == 0) { + /* User aborted */ + buf_desc = wmem_strdup_printf(wmem_packet_scope(), "ABORT %s --> %s", + g_strstrip(assoc->ae_calling), g_strstrip(assoc->ae_called)); + } + else { + /* Provider aborted, slightly more information */ + buf_desc = wmem_strdup_printf(wmem_packet_scope(), "ABORT %s <-- %s (%s)", + g_strstrip(assoc->ae_calling), g_strstrip(assoc->ae_called), abort_reason_desc); + } + + expert_add_info(pinfo, assoc_header_pitem, &ei_dcm_assoc_aborted); + + break; } proto_item_set_text(assoc_header_pitem, "%s", buf_desc); col_append_str(pinfo->cinfo, COL_INFO, buf_desc); - col_set_str(pinfo->cinfo, COL_INFO, wmem_strdup(wmem_file_scope(), buf_desc)); /* requires SE not EP memory */ + col_set_str(pinfo->cinfo, COL_INFO, wmem_strdup(wmem_file_scope(), buf_desc)); /* requires SE not EP memory */ /* proto_item and proto_tree are one and the same */ proto_item_append_text(tree, ", %s", buf_desc); @@ -4885,12 +4885,12 @@ dissect_dcm_assoc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu static void dissect_dcm_assoc_item(tvbuff_t *tvb, proto_tree *tree, guint32 offset, - const gchar *pitem_prefix, int item_value_type, - gchar **item_value, const gchar **item_description, - int *hf_type, int *hf_len, int *hf_value, int ett_subtree) + const gchar *pitem_prefix, int item_value_type, + gchar **item_value, const gchar **item_description, + int *hf_type, int *hf_len, int *hf_value, int ett_subtree) { /* - * Decode one item in a association request or response. Lookup UIDs if requested + * Decode one item in a association request or response. Lookup UIDs if requested * * If dcm_tree is set, create a Subtree Node with summary and three elements * - item_type @@ -4899,7 +4899,7 @@ dissect_dcm_assoc_item(tvbuff_t *tvb, proto_tree *tree, guint32 offset, * */ - proto_tree *assoc_item_ptree; /* Tree for item details */ + proto_tree *assoc_item_ptree; /* Tree for item details */ proto_item *assoc_item_pitem; dcm_uid_t *uid = NULL; @@ -4908,12 +4908,12 @@ dissect_dcm_assoc_item(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint8 item_type = 0; guint16 item_len = 0; - gchar *buf_desc = NULL; /* Used for item text */ + gchar *buf_desc = NULL; /* Used for item text */ *item_value = NULL; *item_description = NULL; - buf_desc = (gchar *)wmem_alloc0(wmem_packet_scope(), MAX_BUF_LEN); /* Valid for this packet */ + buf_desc = (gchar *)wmem_alloc0(wmem_packet_scope(), MAX_BUF_LEN); /* Valid for this packet */ item_type = tvb_get_guint8(tvb, offset); item_len = tvb_get_ntohs(tvb, offset+2); @@ -4925,42 +4925,42 @@ dissect_dcm_assoc_item(tvbuff_t *tvb, proto_tree *tree, guint32 offset, switch (item_value_type) { case DCM_ITEM_VALUE_TYPE_UID: - *item_value = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, item_len, ENC_ASCII); + *item_value = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, item_len, ENC_ASCII); - uid = (dcm_uid_t *)g_hash_table_lookup(dcm_uid_table, (gpointer) *item_value); - if (uid) { - *item_description = uid->name; - g_snprintf(buf_desc, MAX_BUF_LEN, "%s (%s)", *item_description, *item_value); - } - else { - /* Unknown UID, or no UID at all */ - g_snprintf(buf_desc, MAX_BUF_LEN, "%s", *item_value); - } + uid = (dcm_uid_t *)g_hash_table_lookup(dcm_uid_table, (gpointer) *item_value); + if (uid) { + *item_description = uid->name; + g_snprintf(buf_desc, MAX_BUF_LEN, "%s (%s)", *item_description, *item_value); + } + else { + /* Unknown UID, or no UID at all */ + g_snprintf(buf_desc, MAX_BUF_LEN, "%s", *item_value); + } - proto_item_append_text(assoc_item_pitem, "%s", buf_desc); - proto_tree_add_string(assoc_item_ptree, *hf_value, tvb, offset+4, item_len, buf_desc); + proto_item_append_text(assoc_item_pitem, "%s", buf_desc); + proto_tree_add_string(assoc_item_ptree, *hf_value, tvb, offset+4, item_len, buf_desc); - break; + break; case DCM_ITEM_VALUE_TYPE_STRING: - *item_value = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, item_len, ENC_ASCII); + *item_value = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, item_len, ENC_ASCII); proto_item_append_text(assoc_item_pitem, "%s", *item_value); - proto_tree_add_string(assoc_item_ptree, *hf_value, tvb, offset+4, item_len, *item_value); + proto_tree_add_string(assoc_item_ptree, *hf_value, tvb, offset+4, item_len, *item_value); - break; + break; case DCM_ITEM_VALUE_TYPE_UINT32: - item_number = tvb_get_ntohl(tvb, offset+4); - *item_value = (gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); - g_snprintf(*item_value, MAX_BUF_LEN, "%d", item_number); + item_number = tvb_get_ntohl(tvb, offset+4); + *item_value = (gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); + g_snprintf(*item_value, MAX_BUF_LEN, "%d", item_number); - proto_item_append_text(assoc_item_pitem, "%s", *item_value); - proto_tree_add_item(assoc_item_ptree, *hf_value, tvb, offset+4, 4, ENC_BIG_ENDIAN); + proto_item_append_text(assoc_item_pitem, "%s", *item_value); + proto_tree_add_item(assoc_item_ptree, *hf_value, tvb, offset+4, 4, ENC_BIG_ENDIAN); - break; + break; default: - break; + break; } } @@ -4968,22 +4968,22 @@ static void dissect_dcm_assoc_sopclass_extneg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { /* - * Decode the SOP Class Extended Negotiation Sub-Item Fields in a association request or response. - * Lookup UIDs if requested + * Decode the SOP Class Extended Negotiation Sub-Item Fields in a association request or response. + * Lookup UIDs if requested */ - proto_tree *assoc_item_extneg_tree = NULL; /* Tree for item details */ + proto_tree *assoc_item_extneg_tree = NULL; /* Tree for item details */ proto_item *assoc_item_extneg_item = NULL; guint16 item_len = 0; guint16 sop_class_uid_len = 0; gint32 cnt = 0; - gchar *buf_desc = NULL; /* Used for item text */ + gchar *buf_desc = NULL; /* Used for item text */ dcm_uid_t *sopclassuid=NULL; gchar *sopclassuid_str = NULL; - buf_desc = (gchar *)wmem_alloc0(wmem_packet_scope(), MAX_BUF_LEN); /* Valid for this packet */ + buf_desc = (gchar *)wmem_alloc0(wmem_packet_scope(), MAX_BUF_LEN); /* Valid for this packet */ item_len = tvb_get_ntohs(tvb, offset+2); sop_class_uid_len = tvb_get_ntohs(tvb, offset+4); @@ -5165,15 +5165,15 @@ dissect_dcm_assoc_async_negotiation(tvbuff_t *tvb, proto_tree *tree, guint32 off static void dissect_dcm_pctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - dcm_state_assoc_t *assoc, guint32 offset, guint32 len, - const gchar *pitem_prefix, gboolean is_assoc_request) + dcm_state_assoc_t *assoc, guint32 offset, guint32 len, + const gchar *pitem_prefix, gboolean is_assoc_request) { /* - Decode a presentation context item in a Association Request or Response - In the response, set the accepted transfer syntax, if any + Decode a presentation context item in a Association Request or Response + In the response, set the accepted transfer syntax, if any */ - proto_tree *pctx_ptree; /* Tree for presentation context details */ + proto_tree *pctx_ptree; /* Tree for presentation context details */ proto_item *pctx_pitem; dcm_state_pctx_t *pctx = NULL; @@ -5181,24 +5181,24 @@ dissect_dcm_pctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 item_type = 0; guint16 item_len = 0; - guint8 pctx_id = 0; /* Presentation Context ID */ + guint8 pctx_id = 0; /* Presentation Context ID */ guint8 pctx_result = 0; - const char *pctx_result_desc = ""; + const char *pctx_result_desc = ""; - gchar *pctx_abss_uid = NULL; /* Abstract Syntax UID alias SOP Class UID */ - const gchar *pctx_abss_desc = NULL; /* Description of UID */ + gchar *pctx_abss_uid = NULL; /* Abstract Syntax UID alias SOP Class UID */ + const gchar *pctx_abss_desc = NULL; /* Description of UID */ - gchar *pctx_xfer_uid = NULL; /* Transfer Syntax UID */ - const gchar *pctx_xfer_desc = NULL; /* Description of UID */ + gchar *pctx_xfer_uid = NULL; /* Transfer Syntax UID */ + const gchar *pctx_xfer_desc = NULL; /* Description of UID */ - gchar *buf_desc = NULL; /* Used in infor mode for item text */ + gchar *buf_desc = NULL; /* Used in infor mode for item text */ guint32 endpos = 0; - int cnt_abbs = 0; /* Number of Abstract Syntax Items */ - int cnt_xfer = 0; /* Number of Transfer Syntax Items */ + int cnt_abbs = 0; /* Number of Abstract Syntax Items */ + int cnt_xfer = 0; /* Number of Transfer Syntax Items */ - buf_desc = (gchar *)wmem_alloc0(wmem_packet_scope(), MAX_BUF_LEN); /* Valid for this packet */ + buf_desc = (gchar *)wmem_alloc0(wmem_packet_scope(), MAX_BUF_LEN); /* Valid for this packet */ endpos = offset + len; @@ -5208,12 +5208,12 @@ dissect_dcm_pctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pctx_ptree = proto_tree_add_subtree(tree, tvb, offset-4, item_len+4, ett_assoc_pctx, &pctx_pitem, pitem_prefix); pctx_id = tvb_get_guint8(tvb, offset); - pctx_result = tvb_get_guint8(tvb, 2 + offset); /* only set in responses, otherwise reserved and 0x00 */ + pctx_result = tvb_get_guint8(tvb, 2 + offset); /* only set in responses, otherwise reserved and 0x00 */ /* Find or create dicom context object */ pctx = dcm_state_pctx_get(assoc, pctx_id, TRUE); - if (pctx == NULL) { /* Internal error. Failed to create data structure */ - return; + if (pctx == NULL) { /* Internal error. Failed to create data structure */ + return; } proto_tree_add_uint(pctx_ptree, hf_dcm_assoc_item_type, tvb, offset-4, 2, item_type); @@ -5222,98 +5222,98 @@ dissect_dcm_pctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_uint_format(pctx_ptree, hf_dcm_pctx_id, tvb, offset, 1, pctx_id, "Context ID: 0x%02x", pctx_id); if (!is_assoc_request) { - /* Association response. */ - - switch (pctx_result) { - case 0: pctx_result_desc = "Accept"; break; - case 1: pctx_result_desc = "User Reject"; break; - case 2: pctx_result_desc = "No Reason"; break; - case 3: pctx_result_desc = "Abstract Syntax Unsupported"; break; - case 4: pctx_result_desc = "Transfer Syntax Unsupported"; break; - } - - proto_tree_add_uint_format(pctx_ptree, hf_dcm_pctx_result, tvb, offset+2, 1, - pctx_result, "Result: %s (0x%x)", pctx_result_desc, pctx_result); + /* Association response. */ + + switch (pctx_result) { + case 0: pctx_result_desc = "Accept"; break; + case 1: pctx_result_desc = "User Reject"; break; + case 2: pctx_result_desc = "No Reason"; break; + case 3: pctx_result_desc = "Abstract Syntax Unsupported"; break; + case 4: pctx_result_desc = "Transfer Syntax Unsupported"; break; + } + + proto_tree_add_uint_format(pctx_ptree, hf_dcm_pctx_result, tvb, offset+2, 1, + pctx_result, "Result: %s (0x%x)", pctx_result_desc, pctx_result); } offset += 4; while (offset < endpos) { - item_type = tvb_get_guint8(tvb, offset); - item_len = tvb_get_ntohs(tvb, 2 + offset); - - offset += 4; - switch (item_type) { - case 0x30: /* Abstract syntax */ - - /* Parse Item. Works also in info mode where dcm_pctx_tree is NULL */ - dissect_dcm_assoc_item(tvb, pctx_ptree, offset-4, - "Abstract Syntax: ", DCM_ITEM_VALUE_TYPE_UID, &pctx_abss_uid, &pctx_abss_desc, - &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_pctx_abss_syntax, ett_assoc_pctx_abss); - - cnt_abbs += 1; - offset += item_len; - break; - - case 0x40: /* Transfer syntax */ - - dissect_dcm_assoc_item(tvb, pctx_ptree, offset-4, - "Transfer Syntax: ", DCM_ITEM_VALUE_TYPE_UID, &pctx_xfer_uid, &pctx_xfer_desc, - &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_pctx_xfer_syntax, ett_assoc_pctx_xfer); - - /* - In a correct Association Response, only one Transfer syntax shall be present. - Therefore, pctx_xfer_uid, pctx_xfer_desc are used for the accept scenario in the info mode - */ - - if (!is_assoc_request && pctx_result == 0) { - /* Association Response, Context Accepted */ - dcm_set_syntax(pctx, pctx_xfer_uid, pctx_xfer_desc); - } - cnt_xfer += 1; - offset += item_len; - break; - - default: - offset += item_len; - break; - } + item_type = tvb_get_guint8(tvb, offset); + item_len = tvb_get_ntohs(tvb, 2 + offset); + + offset += 4; + switch (item_type) { + case 0x30: /* Abstract syntax */ + + /* Parse Item. Works also in info mode where dcm_pctx_tree is NULL */ + dissect_dcm_assoc_item(tvb, pctx_ptree, offset-4, + "Abstract Syntax: ", DCM_ITEM_VALUE_TYPE_UID, &pctx_abss_uid, &pctx_abss_desc, + &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_pctx_abss_syntax, ett_assoc_pctx_abss); + + cnt_abbs += 1; + offset += item_len; + break; + + case 0x40: /* Transfer syntax */ + + dissect_dcm_assoc_item(tvb, pctx_ptree, offset-4, + "Transfer Syntax: ", DCM_ITEM_VALUE_TYPE_UID, &pctx_xfer_uid, &pctx_xfer_desc, + &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_pctx_xfer_syntax, ett_assoc_pctx_xfer); + + /* + In a correct Association Response, only one Transfer syntax shall be present. + Therefore, pctx_xfer_uid, pctx_xfer_desc are used for the accept scenario in the info mode + */ + + if (!is_assoc_request && pctx_result == 0) { + /* Association Response, Context Accepted */ + dcm_set_syntax(pctx, pctx_xfer_uid, pctx_xfer_desc); + } + cnt_xfer += 1; + offset += item_len; + break; + + default: + offset += item_len; + break; + } } if (is_assoc_request) { - if (cnt_abbs<1) { - expert_add_info(pinfo, pctx_pitem, &ei_dcm_no_abstract_syntax); - return; - } - else if (cnt_abbs>1) { - expert_add_info(pinfo, pctx_pitem, &ei_dcm_multiple_abstract_syntax); - return; - } - - if (cnt_xfer==0) { - expert_add_info(pinfo, pctx_pitem, &ei_dcm_no_transfer_syntax); - return; - } - - if (pctx_abss_uid==NULL) { - expert_add_info(pinfo, pctx_pitem, &ei_dcm_no_abstract_syntax_uid); - return; - } + if (cnt_abbs<1) { + expert_add_info(pinfo, pctx_pitem, &ei_dcm_no_abstract_syntax); + return; + } + else if (cnt_abbs>1) { + expert_add_info(pinfo, pctx_pitem, &ei_dcm_multiple_abstract_syntax); + return; + } + + if (cnt_xfer==0) { + expert_add_info(pinfo, pctx_pitem, &ei_dcm_no_transfer_syntax); + return; + } + + if (pctx_abss_uid==NULL) { + expert_add_info(pinfo, pctx_pitem, &ei_dcm_no_abstract_syntax_uid); + return; + } } else { - if (cnt_xfer>1) { - expert_add_info(pinfo, pctx_pitem, &ei_dcm_multiple_transfer_syntax); - return; - } + if (cnt_xfer>1) { + expert_add_info(pinfo, pctx_pitem, &ei_dcm_multiple_transfer_syntax); + return; + } } if (pctx->abss_uid==NULL) { - /* Permanent copy information into structure */ - pctx->abss_uid = wmem_strdup(wmem_file_scope(), pctx_abss_uid); - pctx->abss_desc = wmem_strdup(wmem_file_scope(), pctx_abss_desc); + /* Permanent copy information into structure */ + pctx->abss_uid = wmem_strdup(wmem_file_scope(), pctx_abss_uid); + pctx->abss_desc = wmem_strdup(wmem_file_scope(), pctx_abss_desc); } /* @@ -5323,30 +5323,30 @@ dissect_dcm_pctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, */ if (is_assoc_request) { - if (pctx_abss_desc == NULL) { - g_snprintf(buf_desc, MAX_BUF_LEN, "%s", pctx_abss_uid); - } - else { - g_snprintf(buf_desc, MAX_BUF_LEN, "%s (%s)", pctx_abss_desc, pctx_abss_uid); - } + if (pctx_abss_desc == NULL) { + g_snprintf(buf_desc, MAX_BUF_LEN, "%s", pctx_abss_uid); + } + else { + g_snprintf(buf_desc, MAX_BUF_LEN, "%s (%s)", pctx_abss_desc, pctx_abss_uid); + } } else { - /* g_snprintf() does not like NULL pointers */ - - if (pctx_result==0) { - /* Accepted */ - g_snprintf(buf_desc, MAX_BUF_LEN, "ID 0x%02x, %s, %s, %s", - pctx_id, pctx_result_desc, - dcm_uid_or_desc(pctx->xfer_uid, pctx->xfer_desc), - dcm_uid_or_desc(pctx->abss_uid, pctx->abss_desc)); - } - else { - /* Rejected */ - g_snprintf(buf_desc, MAX_BUF_LEN, "ID 0x%02x, %s, %s", - pctx_id, pctx_result_desc, - dcm_uid_or_desc(pctx->abss_uid, pctx->abss_desc)); - } + /* g_snprintf() does not like NULL pointers */ + + if (pctx_result==0) { + /* Accepted */ + g_snprintf(buf_desc, MAX_BUF_LEN, "ID 0x%02x, %s, %s, %s", + pctx_id, pctx_result_desc, + dcm_uid_or_desc(pctx->xfer_uid, pctx->xfer_desc), + dcm_uid_or_desc(pctx->abss_uid, pctx->abss_desc)); + } + else { + /* Rejected */ + g_snprintf(buf_desc, MAX_BUF_LEN, "ID 0x%02x, %s, %s", + pctx_id, pctx_result_desc, + dcm_uid_or_desc(pctx->abss_uid, pctx->abss_desc)); + } } proto_item_append_text(pctx_pitem, "%s", buf_desc); @@ -5356,11 +5356,11 @@ static void dissect_dcm_userinfo(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 len, const gchar *pitem_prefix) { /* - Decode the user info item in a Association Request or Response + Decode the user info item in a Association Request or Response */ proto_item *userinfo_pitem = NULL; - proto_tree *userinfo_ptree = NULL; /* Tree for presentation context details */ + proto_tree *userinfo_ptree = NULL; /* Tree for presentation context details */ guint8 item_type; guint16 item_len; @@ -5388,91 +5388,91 @@ dissect_dcm_userinfo(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 le while (offset < endpos) { - item_type = tvb_get_guint8(tvb, offset); - item_len = tvb_get_ntohs(tvb, 2 + offset); + item_type = tvb_get_guint8(tvb, offset); + item_len = tvb_get_ntohs(tvb, 2 + offset); - offset += 4; - switch (item_type) { - case 0x51: /* Max length */ + offset += 4; + switch (item_type) { + case 0x51: /* Max length */ - dissect_dcm_assoc_item(tvb, userinfo_ptree, offset-4, - "Max PDU Length: ", DCM_ITEM_VALUE_TYPE_UINT32, &info_max_pdu, &dummy, - &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_pdu_maxlen, ett_assoc_info_uid); + dissect_dcm_assoc_item(tvb, userinfo_ptree, offset-4, + "Max PDU Length: ", DCM_ITEM_VALUE_TYPE_UINT32, &info_max_pdu, &dummy, + &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_pdu_maxlen, ett_assoc_info_uid); - if (!first_item) { - proto_item_append_text(userinfo_pitem, ", "); - } - proto_item_append_text(userinfo_pitem, "Max PDU Length %s", info_max_pdu); - first_item=FALSE; + if (!first_item) { + proto_item_append_text(userinfo_pitem, ", "); + } + proto_item_append_text(userinfo_pitem, "Max PDU Length %s", info_max_pdu); + first_item=FALSE; - offset += item_len; - break; + offset += item_len; + break; - case 0x52: /* UID */ + case 0x52: /* UID */ - /* Parse Item. Works also in info mode where dcm_pctx_tree is NULL */ - dissect_dcm_assoc_item(tvb, userinfo_ptree, offset-4, - "Implementation UID: ", DCM_ITEM_VALUE_TYPE_STRING, &info_impl_uid, &dummy, - &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_info_uid, ett_assoc_info_uid); + /* Parse Item. Works also in info mode where dcm_pctx_tree is NULL */ + dissect_dcm_assoc_item(tvb, userinfo_ptree, offset-4, + "Implementation UID: ", DCM_ITEM_VALUE_TYPE_STRING, &info_impl_uid, &dummy, + &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_info_uid, ett_assoc_info_uid); - if (!first_item) { - proto_item_append_text(userinfo_pitem, ", "); - } - proto_item_append_text(userinfo_pitem, "Implementation UID %s", info_impl_uid); - first_item=FALSE; + if (!first_item) { + proto_item_append_text(userinfo_pitem, ", "); + } + proto_item_append_text(userinfo_pitem, "Implementation UID %s", info_impl_uid); + first_item=FALSE; - offset += item_len; - break; + offset += item_len; + break; - case 0x55: /* version */ + case 0x55: /* version */ - dissect_dcm_assoc_item(tvb, userinfo_ptree, offset-4, - "Implementation Version: ", DCM_ITEM_VALUE_TYPE_STRING, &info_impl_version, &dummy, - &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_info_version, ett_assoc_info_version); + dissect_dcm_assoc_item(tvb, userinfo_ptree, offset-4, + "Implementation Version: ", DCM_ITEM_VALUE_TYPE_STRING, &info_impl_version, &dummy, + &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_info_version, ett_assoc_info_version); - if (!first_item) { - proto_item_append_text(userinfo_pitem, ", "); - } - proto_item_append_text(userinfo_pitem, "Version %s", info_impl_version); - first_item=FALSE; + if (!first_item) { + proto_item_append_text(userinfo_pitem, ", "); + } + proto_item_append_text(userinfo_pitem, "Version %s", info_impl_version); + first_item=FALSE; - offset += item_len; - break; + offset += item_len; + break; - case 0x53: /* async negotiation */ + case 0x53: /* async negotiation */ - dissect_dcm_assoc_async_negotiation(tvb, userinfo_ptree, offset-4); + dissect_dcm_assoc_async_negotiation(tvb, userinfo_ptree, offset-4); - offset += item_len; - break; + offset += item_len; + break; - case 0x54: /* scp/scu role selection */ + case 0x54: /* scp/scu role selection */ - dissect_dcm_assoc_role_selection(tvb, userinfo_ptree, offset-4); + dissect_dcm_assoc_role_selection(tvb, userinfo_ptree, offset-4); - offset += item_len; - break; + offset += item_len; + break; - case 0x56: /* extended negotiation */ + case 0x56: /* extended negotiation */ - dissect_dcm_assoc_sopclass_extneg(tvb, userinfo_ptree, offset-4); + dissect_dcm_assoc_sopclass_extneg(tvb, userinfo_ptree, offset-4); - offset += item_len; - break; + offset += item_len; + break; - default: - offset += item_len; - break; - } + default: + offset += item_len; + break; + } } } static guint32 dissect_dcm_assoc_detail(tvbuff_t *tvb, packet_info *pinfo, proto_item *ti, - dcm_state_assoc_t *assoc, guint32 offset, guint32 len) + dcm_state_assoc_t *assoc, guint32 offset, guint32 len) { - proto_tree *assoc_tree = NULL; /* Tree for PDU details */ + proto_tree *assoc_tree = NULL; /* Tree for PDU details */ guint8 item_type; guint16 item_len; @@ -5487,46 +5487,46 @@ dissect_dcm_assoc_detail(tvbuff_t *tvb, packet_info *pinfo, proto_item *ti, assoc_tree = proto_item_add_subtree(ti, ett_assoc); while (offset < endpos) { - item_type = tvb_get_guint8(tvb, offset); - item_len = tvb_get_ntohs(tvb, 2 + offset); - - if (item_len == 0) { - expert_add_info(pinfo, ti, &ei_dcm_assoc_item_len); - return endpos; - } - - offset += 4; - - switch (item_type) { - case 0x10: /* Application context */ - dissect_dcm_assoc_item(tvb, assoc_tree, offset-4, - "Application Context: ", DCM_ITEM_VALUE_TYPE_UID, &item_value, &item_description, - &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_actx, ett_assoc_actx); - - offset += item_len; - break; - - case 0x20: /* Presentation context request */ - dissect_dcm_pctx(tvb, pinfo, assoc_tree, assoc, offset, item_len, - "Presentation Context: ", TRUE); - offset += item_len; - break; - - case 0x21: /* Presentation context reply */ - dissect_dcm_pctx(tvb, pinfo, assoc_tree, assoc, offset, item_len, - "Presentation Context: ", FALSE); - offset += item_len; - break; - - case 0x50: /* User Info */ - dissect_dcm_userinfo(tvb, assoc_tree, offset, item_len, "User Info: "); - offset += item_len; - break; - - default: - offset += item_len; - break; - } + item_type = tvb_get_guint8(tvb, offset); + item_len = tvb_get_ntohs(tvb, 2 + offset); + + if (item_len == 0) { + expert_add_info(pinfo, ti, &ei_dcm_assoc_item_len); + return endpos; + } + + offset += 4; + + switch (item_type) { + case 0x10: /* Application context */ + dissect_dcm_assoc_item(tvb, assoc_tree, offset-4, + "Application Context: ", DCM_ITEM_VALUE_TYPE_UID, &item_value, &item_description, + &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_actx, ett_assoc_actx); + + offset += item_len; + break; + + case 0x20: /* Presentation context request */ + dissect_dcm_pctx(tvb, pinfo, assoc_tree, assoc, offset, item_len, + "Presentation Context: ", TRUE); + offset += item_len; + break; + + case 0x21: /* Presentation context reply */ + dissect_dcm_pctx(tvb, pinfo, assoc_tree, assoc, offset, item_len, + "Presentation Context: ", FALSE); + offset += item_len; + break; + + case 0x50: /* User Info */ + dissect_dcm_userinfo(tvb, assoc_tree, offset, item_len, "User Info: "); + offset += item_len; + break; + + default: + offset += item_len; + break; + } } return offset; @@ -5535,18 +5535,18 @@ dissect_dcm_assoc_detail(tvbuff_t *tvb, packet_info *pinfo, proto_item *ti, static guint32 dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - dcm_state_assoc_t *assoc, guint32 offset, dcm_state_pdv_t **pdv) + dcm_state_assoc_t *assoc, guint32 offset, dcm_state_pdv_t **pdv) { /* Dissect Context and Flags of a PDV and create new PDV structure */ proto_item *pdv_ctx_pitem = NULL; proto_item *pdv_flags_pitem = NULL; - dcm_state_pctx_t *pctx = NULL; - dcm_state_pdv_t *pdv_first_data = NULL; + dcm_state_pctx_t *pctx = NULL; + dcm_state_pdv_t *pdv_first_data = NULL; - const gchar *desc_flag = NULL; /* Flag Description in tree */ - gchar *desc_header = NULL; /* Used for PDV description */ + const gchar *desc_flag = NULL; /* Flag Description in tree */ + gchar *desc_header = NULL; /* Used for PDV description */ guint8 flags = 0; guint8 pctx_id = 0; @@ -5556,26 +5556,26 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pctx = dcm_state_pctx_get(assoc, pctx_id, FALSE); if (pctx && pctx->xfer_uid) { - proto_tree_add_uint_format(tree, hf_dcm_pdv_ctx, tvb, offset, 1, - pctx_id, "Context: 0x%02x (%s, %s)", pctx_id, - dcm_uid_or_desc(pctx->xfer_uid, pctx->xfer_desc), - dcm_uid_or_desc(pctx->abss_uid, pctx->abss_desc)); + proto_tree_add_uint_format(tree, hf_dcm_pdv_ctx, tvb, offset, 1, + pctx_id, "Context: 0x%02x (%s, %s)", pctx_id, + dcm_uid_or_desc(pctx->xfer_uid, pctx->xfer_desc), + dcm_uid_or_desc(pctx->abss_uid, pctx->abss_desc)); } else { - pdv_ctx_pitem=proto_tree_add_uint_format(tree, hf_dcm_pdv_ctx, tvb, offset, 1, - pctx_id, "Context: 0x%02x not found. A-ASSOCIATE request not found in capture.", pctx_id); + pdv_ctx_pitem=proto_tree_add_uint_format(tree, hf_dcm_pdv_ctx, tvb, offset, 1, + pctx_id, "Context: 0x%02x not found. A-ASSOCIATE request not found in capture.", pctx_id); - expert_add_info(pinfo, pdv_ctx_pitem, &ei_dcm_pdv_ctx); + expert_add_info(pinfo, pdv_ctx_pitem, &ei_dcm_pdv_ctx); - if (pctx == NULL) { - /* only create presentation context, if it does not yet exist */ + if (pctx == NULL) { + /* only create presentation context, if it does not yet exist */ - /* Create fake PCTX and guess Syntax ILE, ELE, EBE */ - pctx = dcm_state_pctx_new(assoc, pctx_id); + /* Create fake PCTX and guess Syntax ILE, ELE, EBE */ + pctx = dcm_state_pctx_new(assoc, pctx_id); - /* To be done: Guess Syntax */ - pctx->syntax = DCM_UNK; - } + /* To be done: Guess Syntax */ + pctx->syntax = DCM_UNK; + } } offset +=1; @@ -5588,7 +5588,7 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, *pdv = dcm_state_pdv_get(pctx, pinfo->fd->num, tvb_raw_offset(tvb)+offset, TRUE); if (*pdv == NULL) { - return 0; /* Failed to allocate memory */ + return 0; /* Failed to allocate memory */ } /* 1 Byte Flag */ @@ -5596,93 +5596,93 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, (*pdv)->pctx_id = pctx_id; - desc_header=(gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); /* Valid for this capture, since we return this buffer */ + desc_header=(gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); /* Valid for this capture, since we return this buffer */ switch (flags) { - case 0: /* 00 */ - desc_flag = "Data, More Fragments"; - - (*pdv)->is_flagvalid = TRUE; - (*pdv)->is_command = FALSE; - (*pdv)->is_last_fragment = FALSE; - (*pdv)->syntax = pctx->syntax; /* Inherit syntax for data PDVs*/ - break; - - case 2: /* 10 */ - desc_flag = "Data, Last Fragment"; - - (*pdv)->is_flagvalid = TRUE; - (*pdv)->is_command = FALSE; - (*pdv)->is_last_fragment = TRUE; - (*pdv)->syntax = pctx->syntax; /* Inherit syntax for data PDVs*/ - break; - - case 1: /* 01 */ - desc_flag = "Command, More Fragments"; - g_snprintf(desc_header, MAX_BUF_LEN, "Command"); /* Will be overwritten with real command tag */ - - (*pdv)->is_flagvalid = TRUE; - (*pdv)->is_command = TRUE; - (*pdv)->is_last_fragment = FALSE; - (*pdv)->syntax = DCM_ILE; /* Command tags are always little endian*/ - break; - - case 3: /* 11 */ - desc_flag = "Command, Last Fragment"; + case 0: /* 00 */ + desc_flag = "Data, More Fragments"; + + (*pdv)->is_flagvalid = TRUE; + (*pdv)->is_command = FALSE; + (*pdv)->is_last_fragment = FALSE; + (*pdv)->syntax = pctx->syntax; /* Inherit syntax for data PDVs*/ + break; + + case 2: /* 10 */ + desc_flag = "Data, Last Fragment"; + + (*pdv)->is_flagvalid = TRUE; + (*pdv)->is_command = FALSE; + (*pdv)->is_last_fragment = TRUE; + (*pdv)->syntax = pctx->syntax; /* Inherit syntax for data PDVs*/ + break; + + case 1: /* 01 */ + desc_flag = "Command, More Fragments"; + g_snprintf(desc_header, MAX_BUF_LEN, "Command"); /* Will be overwritten with real command tag */ + + (*pdv)->is_flagvalid = TRUE; + (*pdv)->is_command = TRUE; + (*pdv)->is_last_fragment = FALSE; + (*pdv)->syntax = DCM_ILE; /* Command tags are always little endian*/ + break; + + case 3: /* 11 */ + desc_flag = "Command, Last Fragment"; g_snprintf(desc_header, MAX_BUF_LEN, "Command"); - (*pdv)->is_flagvalid = TRUE; - (*pdv)->is_command = TRUE; - (*pdv)->is_last_fragment = TRUE; - (*pdv)->syntax = DCM_ILE; /* Command tags are always little endian*/ - break; + (*pdv)->is_flagvalid = TRUE; + (*pdv)->is_command = TRUE; + (*pdv)->is_last_fragment = TRUE; + (*pdv)->syntax = DCM_ILE; /* Command tags are always little endian*/ + break; default: - desc_flag = "Invalid Flags"; + desc_flag = "Invalid Flags"; g_snprintf(desc_header, MAX_BUF_LEN, "Invalid Flags"); - (*pdv)->is_flagvalid = FALSE; - (*pdv)->is_command = FALSE; - (*pdv)->is_last_fragment = FALSE; - (*pdv)->syntax = DCM_UNK; + (*pdv)->is_flagvalid = FALSE; + (*pdv)->is_command = FALSE; + (*pdv)->is_last_fragment = FALSE; + (*pdv)->syntax = DCM_UNK; } if (flags == 0 || flags == 2) { - /* Data PDV */ - pdv_first_data = dcm_state_pdv_get_obj_start(*pdv); - - if (pdv_first_data->prev && pdv_first_data->prev->is_command) { - /* Every Data PDV sequence should be preceded by a Command PDV, - so we should always hit this for a correct capture - */ - - if (pctx->abss_desc && g_str_has_suffix(pctx->abss_desc, "Storage")) { - /* Should be done far more intelligent, e.g. does not catch the (Retired) ones */ - if (flags == 0) { - g_snprintf(desc_header, MAX_BUF_LEN, "%s Fragment", pctx->abss_desc); - } - else { - g_snprintf(desc_header, MAX_BUF_LEN, "%s", pctx->abss_desc); - } - (*pdv)->is_storage = TRUE; - } - else { - /* Use previous command and append DATA*/ - g_snprintf(desc_header, MAX_BUF_LEN, "%s-DATA", pdv_first_data->prev->desc); - } - } - else { - g_snprintf(desc_header, MAX_BUF_LEN, "DATA"); - } + /* Data PDV */ + pdv_first_data = dcm_state_pdv_get_obj_start(*pdv); + + if (pdv_first_data->prev && pdv_first_data->prev->is_command) { + /* Every Data PDV sequence should be preceded by a Command PDV, + so we should always hit this for a correct capture + */ + + if (pctx->abss_desc && g_str_has_suffix(pctx->abss_desc, "Storage")) { + /* Should be done far more intelligent, e.g. does not catch the (Retired) ones */ + if (flags == 0) { + g_snprintf(desc_header, MAX_BUF_LEN, "%s Fragment", pctx->abss_desc); + } + else { + g_snprintf(desc_header, MAX_BUF_LEN, "%s", pctx->abss_desc); + } + (*pdv)->is_storage = TRUE; + } + else { + /* Use previous command and append DATA*/ + g_snprintf(desc_header, MAX_BUF_LEN, "%s-DATA", pdv_first_data->prev->desc); + } + } + else { + g_snprintf(desc_header, MAX_BUF_LEN, "DATA"); + } } (*pdv)->desc = desc_header; pdv_flags_pitem = proto_tree_add_uint_format(tree, hf_dcm_pdv_flags, tvb, offset, 1, - flags, "Flags: 0x%02x (%s)", flags, desc_flag); + flags, "Flags: 0x%02x (%s)", flags, desc_flag); if (flags>3) { - expert_add_info(pinfo, pdv_flags_pitem, &ei_dcm_pdv_flags); + expert_add_info(pinfo, pdv_flags_pitem, &ei_dcm_pdv_flags); } offset +=1; @@ -5691,8 +5691,8 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static guint32 dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_state_pdv_t *pdv, - guint32 offset, guint16 grp, guint16 elm, - guint32 vl, guint32 vl_max, const gchar* vr, gchar **tag_value) + guint32 offset, guint16 grp, guint16 elm, + guint32 vl, guint32 vl_max, const gchar* vr, gchar **tag_value) { /* Based on the value representation, decode the value of one tag. Returns new offset */ @@ -5700,8 +5700,8 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s gboolean is_little_endian; - if (pdv->syntax == DCM_EBE) is_little_endian = FALSE; - else is_little_endian = TRUE; + if (pdv->syntax == DCM_EBE) is_little_endian = FALSE; + else is_little_endian = TRUE; /* --------------------------------------------------------------------------- @@ -5710,246 +5710,246 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s */ if ((strncmp(vr, "AE", 2) == 0) || (strncmp(vr, "AS", 2) == 0) || (strncmp(vr, "CS", 2) == 0) || - (strncmp(vr, "DA", 2) == 0) || (strncmp(vr, "DS", 2) == 0) || (strncmp(vr, "DT", 2) == 0) || - (strncmp(vr, "IS", 2) == 0) || (strncmp(vr, "LO", 2) == 0) || (strncmp(vr, "LT", 2) == 0) || - (strncmp(vr, "PN", 2) == 0) || (strncmp(vr, "SH", 2) == 0) || (strncmp(vr, "ST", 2) == 0) || - (strncmp(vr, "TM", 2) == 0) || (strncmp(vr, "UI", 2) == 0) || (strncmp(vr, "UT", 2) == 0) ) { - /* 15 ways to represent a string ... */ - - gchar *vals; - dcm_uid_t *uid = NULL; - guint8 val8; - - val8 = tvb_get_guint8(tvb, offset + vl_max - 1); - if (val8 == 0x00) { - /* Last byte of string is 0x00, i.e. padded */ - vals = tvb_format_text(tvb, offset, vl_max - 1); - } - else { - vals = tvb_format_text(tvb, offset, vl_max); - } - - if ((strncmp(vr, "UI", 2) == 0)) { - /* This is a UID. Attempt a lookup. Will only return something for classes of course */ - - uid = (dcm_uid_t *)g_hash_table_lookup(dcm_uid_table, (gpointer) vals); - if (uid) { - g_snprintf(*tag_value, MAX_BUF_LEN, "%s (%s)", vals, uid->name); - } - else { - g_snprintf(*tag_value, MAX_BUF_LEN, "%s", vals); - } - } - else { - if (strlen(vals) > 50) { - g_snprintf(*tag_value, MAX_BUF_LEN, "%-50.50s...", vals); - } - else { - g_snprintf(*tag_value, MAX_BUF_LEN, "%s", vals); - } - } - proto_tree_add_string_format(tree, hf_dcm_tag_value_str, tvb, offset, vl_max, *tag_value, "%-8.8s%s", "Value:", *tag_value); - - if (grp == 0x0000 && elm == 0x0902) { - /* The error comment */ - pdv->comment = wmem_strdup(wmem_file_scope(), g_strstrip(vals)); - } + (strncmp(vr, "DA", 2) == 0) || (strncmp(vr, "DS", 2) == 0) || (strncmp(vr, "DT", 2) == 0) || + (strncmp(vr, "IS", 2) == 0) || (strncmp(vr, "LO", 2) == 0) || (strncmp(vr, "LT", 2) == 0) || + (strncmp(vr, "PN", 2) == 0) || (strncmp(vr, "SH", 2) == 0) || (strncmp(vr, "ST", 2) == 0) || + (strncmp(vr, "TM", 2) == 0) || (strncmp(vr, "UI", 2) == 0) || (strncmp(vr, "UT", 2) == 0) ) { + /* 15 ways to represent a string ... */ + + gchar *vals; + dcm_uid_t *uid = NULL; + guint8 val8; + + val8 = tvb_get_guint8(tvb, offset + vl_max - 1); + if (val8 == 0x00) { + /* Last byte of string is 0x00, i.e. padded */ + vals = tvb_format_text(tvb, offset, vl_max - 1); + } + else { + vals = tvb_format_text(tvb, offset, vl_max); + } + + if ((strncmp(vr, "UI", 2) == 0)) { + /* This is a UID. Attempt a lookup. Will only return something for classes of course */ + + uid = (dcm_uid_t *)g_hash_table_lookup(dcm_uid_table, (gpointer) vals); + if (uid) { + g_snprintf(*tag_value, MAX_BUF_LEN, "%s (%s)", vals, uid->name); + } + else { + g_snprintf(*tag_value, MAX_BUF_LEN, "%s", vals); + } + } + else { + if (strlen(vals) > 50) { + g_snprintf(*tag_value, MAX_BUF_LEN, "%-50.50s...", vals); + } + else { + g_snprintf(*tag_value, MAX_BUF_LEN, "%s", vals); + } + } + proto_tree_add_string_format(tree, hf_dcm_tag_value_str, tvb, offset, vl_max, *tag_value, "%-8.8s%s", "Value:", *tag_value); + + if (grp == 0x0000 && elm == 0x0902) { + /* The error comment */ + pdv->comment = wmem_strdup(wmem_file_scope(), g_strstrip(vals)); + } } else if ((strncmp(vr, "OB", 2) == 0) || (strncmp(vr, "OF", 2) == 0) || - (strncmp(vr, "OW", 2) == 0)) { - /* Array of Bytes, Float or Words. Don't perform any decoding */ + (strncmp(vr, "OW", 2) == 0)) { + /* Array of Bytes, Float or Words. Don't perform any decoding */ - proto_tree_add_bytes_format(tree, hf_dcm_tag_value_byte, tvb, offset, vl_max, - NULL, "%-8.8s%s", "Value:", "(binary)"); + proto_tree_add_bytes_format(tree, hf_dcm_tag_value_byte, tvb, offset, vl_max, + NULL, "%-8.8s%s", "Value:", "(binary)"); - g_snprintf(*tag_value, MAX_BUF_LEN, "(binary)"); + g_snprintf(*tag_value, MAX_BUF_LEN, "(binary)"); } else if (strncmp(vr, "UN", 2) == 0) { - /* Usually the case for private tags in implicit syntax, since tag was not found and vr not specified */ - guint8 val8; - gchar *vals; - guint32 i; - - /* String detector, i.e. check if we only have alpha-numeric character */ - gboolean is_string = TRUE; - gboolean is_padded = FALSE; - - for (i = 0; i < vl_max ; i++) { - val8 = tvb_get_guint8(tvb, offset + i); - - if ((val8 == 0x09) || (val8 == 0x0A) || (val8 == 0x0D)) { - /* TAB, LF, CR */ - } - else if ((val8 >= 0x20) && (val8 <= 0x7E)) { - /* No extended ASCII, 0-9, A-Z, a-z */ - } - else if ((i == vl_max -1) && (val8 == 0x00)) { - /* Last Byte can be null*/ - is_padded = TRUE; - } - else { - /* Here's the code */ - is_string = FALSE; - } - } - - if (is_string) { - vals = tvb_format_text(tvb, offset, (is_padded ? vl_max - 1 : vl_max)); - proto_tree_add_string_format(tree, hf_dcm_tag_value_str, tvb, offset, vl_max, - vals, "%-8.8s%s", "Value:", vals); - - g_snprintf(*tag_value, MAX_BUF_LEN, "%s", vals); - } - else { - proto_tree_add_bytes_format(tree, hf_dcm_tag_value_byte, tvb, offset, vl_max, - NULL, "%-8.8s%s", "Value:", "(binary)"); - - g_snprintf(*tag_value, MAX_BUF_LEN, "(binary)"); - } + /* Usually the case for private tags in implicit syntax, since tag was not found and vr not specified */ + guint8 val8; + gchar *vals; + guint32 i; + + /* String detector, i.e. check if we only have alpha-numeric character */ + gboolean is_string = TRUE; + gboolean is_padded = FALSE; + + for (i = 0; i < vl_max ; i++) { + val8 = tvb_get_guint8(tvb, offset + i); + + if ((val8 == 0x09) || (val8 == 0x0A) || (val8 == 0x0D)) { + /* TAB, LF, CR */ + } + else if ((val8 >= 0x20) && (val8 <= 0x7E)) { + /* No extended ASCII, 0-9, A-Z, a-z */ + } + else if ((i == vl_max -1) && (val8 == 0x00)) { + /* Last Byte can be null*/ + is_padded = TRUE; + } + else { + /* Here's the code */ + is_string = FALSE; + } + } + + if (is_string) { + vals = tvb_format_text(tvb, offset, (is_padded ? vl_max - 1 : vl_max)); + proto_tree_add_string_format(tree, hf_dcm_tag_value_str, tvb, offset, vl_max, + vals, "%-8.8s%s", "Value:", vals); + + g_snprintf(*tag_value, MAX_BUF_LEN, "%s", vals); + } + else { + proto_tree_add_bytes_format(tree, hf_dcm_tag_value_byte, tvb, offset, vl_max, + NULL, "%-8.8s%s", "Value:", "(binary)"); + + g_snprintf(*tag_value, MAX_BUF_LEN, "(binary)"); + } } /* --------------------------------------------------------------------------- Smaller types. vl/vl_max are not used. Fixed item length from 2 to 8 bytes --------------------------------------------------------------------------- */ - else if (strncmp(vr, "AT", 2) == 0) { /* Attribute Tag */ - /* 2*2 Bytes */ + else if (strncmp(vr, "AT", 2) == 0) { /* Attribute Tag */ + /* 2*2 Bytes */ - guint16 at_grp; - guint16 at_elm; + guint16 at_grp; + guint16 at_elm; - if (is_little_endian) at_grp = tvb_get_letohs(tvb, offset); - else at_grp = tvb_get_ntohs(tvb, offset); + if (is_little_endian) at_grp = tvb_get_letohs(tvb, offset); + else at_grp = tvb_get_ntohs(tvb, offset); - if (is_little_endian) at_elm = tvb_get_letohs(tvb, offset); - else at_elm = tvb_get_ntohs(tvb, offset); + if (is_little_endian) at_elm = tvb_get_letohs(tvb, offset); + else at_elm = tvb_get_ntohs(tvb, offset); - proto_tree_add_uint_format(tree, hf_dcm_tag_value_32u, tvb, offset, 4, - (at_grp << 16) | at_elm, "%-8.8s%04x,%04x", "Value:", at_grp, at_elm); + proto_tree_add_uint_format(tree, hf_dcm_tag_value_32u, tvb, offset, 4, + (at_grp << 16) | at_elm, "%-8.8s%04x,%04x", "Value:", at_grp, at_elm); - g_snprintf(*tag_value, MAX_BUF_LEN, "(%04x,%04x)", at_grp, at_elm); + g_snprintf(*tag_value, MAX_BUF_LEN, "(%04x,%04x)", at_grp, at_elm); } - else if (strncmp(vr, "FL", 2) == 0) { /* Single Float */ + else if (strncmp(vr, "FL", 2) == 0) { /* Single Float */ - gfloat valf; + gfloat valf; - if (is_little_endian) valf = tvb_get_letohieee_float(tvb, offset); - else valf = tvb_get_ntohieee_float(tvb, offset); + if (is_little_endian) valf = tvb_get_letohieee_float(tvb, offset); + else valf = tvb_get_ntohieee_float(tvb, offset); - proto_tree_add_bytes_format(tree, hf_dcm_tag_value_byte, tvb, offset, 4, - NULL, "%-8.8s%f", "Value:", valf); + proto_tree_add_bytes_format(tree, hf_dcm_tag_value_byte, tvb, offset, 4, + NULL, "%-8.8s%f", "Value:", valf); - g_snprintf(*tag_value, MAX_BUF_LEN, "%f", valf); + g_snprintf(*tag_value, MAX_BUF_LEN, "%f", valf); } - else if (strncmp(vr, "FD", 2) == 0) { /* Double Float */ + else if (strncmp(vr, "FD", 2) == 0) { /* Double Float */ - gdouble vald; + gdouble vald; - if (is_little_endian) vald = tvb_get_letohieee_double(tvb, offset); - else vald = tvb_get_ntohieee_double(tvb, offset); + if (is_little_endian) vald = tvb_get_letohieee_double(tvb, offset); + else vald = tvb_get_ntohieee_double(tvb, offset); proto_tree_add_bytes_format(tree, hf_dcm_tag_value_byte, tvb, offset, 8, - NULL, "%-8.8s%f", "Value:", vald); + NULL, "%-8.8s%f", "Value:", vald); - g_snprintf(*tag_value, MAX_BUF_LEN, "%f", vald); + g_snprintf(*tag_value, MAX_BUF_LEN, "%f", vald); } - else if (strncmp(vr, "SL", 2) == 0) { /* Signed Long */ - gint32 val32; + else if (strncmp(vr, "SL", 2) == 0) { /* Signed Long */ + gint32 val32; - if (is_little_endian) val32 = tvb_get_letohl(tvb, offset); - else val32 = tvb_get_ntohl(tvb, offset); + if (is_little_endian) val32 = tvb_get_letohl(tvb, offset); + else val32 = tvb_get_ntohl(tvb, offset); - proto_tree_add_int_format(tree, hf_dcm_tag_value_32s, tvb, offset, 4, - val32, "%-8.8s%d", "Value:", val32); + proto_tree_add_int_format(tree, hf_dcm_tag_value_32s, tvb, offset, 4, + val32, "%-8.8s%d", "Value:", val32); - g_snprintf(*tag_value, MAX_BUF_LEN, "%d", val32); + g_snprintf(*tag_value, MAX_BUF_LEN, "%d", val32); } - else if (strncmp(vr, "SS", 2) == 0) { /* Signed Short */ - gint16 val16; + else if (strncmp(vr, "SS", 2) == 0) { /* Signed Short */ + gint16 val16; - if (is_little_endian) val16 = tvb_get_letohs(tvb, offset); - else val16 = tvb_get_ntohs(tvb, offset); + if (is_little_endian) val16 = tvb_get_letohs(tvb, offset); + else val16 = tvb_get_ntohs(tvb, offset); - proto_tree_add_int_format(tree, hf_dcm_tag_value_16s, tvb, offset, 2, - val16, "%-8.8s%d", "Value:", val16); + proto_tree_add_int_format(tree, hf_dcm_tag_value_16s, tvb, offset, 2, + val16, "%-8.8s%d", "Value:", val16); - g_snprintf(*tag_value, MAX_BUF_LEN, "%d", val16); + g_snprintf(*tag_value, MAX_BUF_LEN, "%d", val16); } - else if (strncmp(vr, "UL", 2) == 0) { /* Unsigned Long */ - guint32 val32; + else if (strncmp(vr, "UL", 2) == 0) { /* Unsigned Long */ + guint32 val32; - if (is_little_endian) val32 = tvb_get_letohl(tvb, offset); - else val32 = tvb_get_ntohl(tvb, offset); + if (is_little_endian) val32 = tvb_get_letohl(tvb, offset); + else val32 = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint_format(tree, hf_dcm_tag_value_32u, tvb, offset, 4, - val32, "%-8.8s%u", "Value:", val32); + proto_tree_add_uint_format(tree, hf_dcm_tag_value_32u, tvb, offset, 4, + val32, "%-8.8s%u", "Value:", val32); - g_snprintf(*tag_value, MAX_BUF_LEN, "%u", val32); + g_snprintf(*tag_value, MAX_BUF_LEN, "%u", val32); } - else if (strncmp(vr, "US", 2) == 0) { /* Unsigned Short */ - const gchar *status_message = NULL; - guint16 val16; - - if (is_little_endian) val16 = tvb_get_letohs(tvb, offset); - else val16 = tvb_get_ntohs(tvb, offset); - - if (grp == 0x0000 && elm == 0x0100) { - /* This is a command */ - g_snprintf(*tag_value, MAX_BUF_LEN, "%s", dcm_cmd2str(val16)); - - pdv->command = wmem_strdup(wmem_file_scope(), *tag_value); - } - else if (grp == 0x0000 && elm == 0x0900) { - /* This is a status message. If value is not 0x0000, add an expert info */ - - status_message = dcm_rsp2str(val16); - g_snprintf(*tag_value, MAX_BUF_LEN, "%s (0x%02x)", status_message, val16); - - if (val16 != 0x0000 && ((val16 & 0xFF00) != 0xFF00)) { - /* Not 0x0000 0xFFxx */ - pdv->is_warning = TRUE; - } - - pdv->status = wmem_strdup(wmem_file_scope(), status_message); - - } - else { - g_snprintf(*tag_value, MAX_BUF_LEN, "%u", val16); - } - - if (grp == 0x0000) { - if (elm == 0x0110) { /* (0000,0110) Message ID */ - pdv->message_id = val16; - } - else if (elm == 0x0120) { /* (0000,0120) Message ID Being Responded To */ - pdv->message_id_resp = val16; - } - else if (elm == 0x1020) { /* (0000,1020) Number of Remaining Sub-operations */ - pdv->no_remaining = val16; - } - else if (elm == 0x1021) { /* (0000,1021) Number of Completed Sub-operations */ - pdv->no_completed = val16; - } - else if (elm == 0x1022) { /* (0000,1022) Number of Failed Sub-operations */ - pdv->no_failed = val16; - } - else if (elm == 0x1023) { /* (0000,1023) Number of Warning Sub-operations */ - pdv->no_warning = val16; - } - } - - pitem = proto_tree_add_uint_format(tree, hf_dcm_tag_value_16u, tvb, offset, 2, - val16, "%-8.8s%s", "Value:", *tag_value); - - if (pdv->is_warning && status_message) { - expert_add_info(pinfo, pitem, &ei_dcm_status_msg); - } + else if (strncmp(vr, "US", 2) == 0) { /* Unsigned Short */ + const gchar *status_message = NULL; + guint16 val16; + + if (is_little_endian) val16 = tvb_get_letohs(tvb, offset); + else val16 = tvb_get_ntohs(tvb, offset); + + if (grp == 0x0000 && elm == 0x0100) { + /* This is a command */ + g_snprintf(*tag_value, MAX_BUF_LEN, "%s", dcm_cmd2str(val16)); + + pdv->command = wmem_strdup(wmem_file_scope(), *tag_value); + } + else if (grp == 0x0000 && elm == 0x0900) { + /* This is a status message. If value is not 0x0000, add an expert info */ + + status_message = dcm_rsp2str(val16); + g_snprintf(*tag_value, MAX_BUF_LEN, "%s (0x%02x)", status_message, val16); + + if (val16 != 0x0000 && ((val16 & 0xFF00) != 0xFF00)) { + /* Not 0x0000 0xFFxx */ + pdv->is_warning = TRUE; + } + + pdv->status = wmem_strdup(wmem_file_scope(), status_message); + + } + else { + g_snprintf(*tag_value, MAX_BUF_LEN, "%u", val16); + } + + if (grp == 0x0000) { + if (elm == 0x0110) { /* (0000,0110) Message ID */ + pdv->message_id = val16; + } + else if (elm == 0x0120) { /* (0000,0120) Message ID Being Responded To */ + pdv->message_id_resp = val16; + } + else if (elm == 0x1020) { /* (0000,1020) Number of Remaining Sub-operations */ + pdv->no_remaining = val16; + } + else if (elm == 0x1021) { /* (0000,1021) Number of Completed Sub-operations */ + pdv->no_completed = val16; + } + else if (elm == 0x1022) { /* (0000,1022) Number of Failed Sub-operations */ + pdv->no_failed = val16; + } + else if (elm == 0x1023) { /* (0000,1023) Number of Warning Sub-operations */ + pdv->no_warning = val16; + } + } + + pitem = proto_tree_add_uint_format(tree, hf_dcm_tag_value_16u, tvb, offset, 2, + val16, "%-8.8s%s", "Value:", *tag_value); + + if (pdv->is_warning && status_message) { + expert_add_info(pinfo, pitem, &ei_dcm_status_msg); + } } /* Invalid VR, can only occur with Explicit syntax */ else { - proto_tree_add_bytes_format(tree, hf_dcm_tag_value_byte, tvb, offset, vl_max, - NULL, "%-8.8s%s", "Value:", (vl > vl_max ? "" : "(unknown VR)")); + proto_tree_add_bytes_format(tree, hf_dcm_tag_value_byte, tvb, offset, vl_max, + NULL, "%-8.8s%s", "Value:", (vl > vl_max ? "" : "(unknown VR)")); - g_snprintf(*tag_value, MAX_BUF_LEN, "(unknown VR)"); + g_snprintf(*tag_value, MAX_BUF_LEN, "(unknown VR)"); } offset += vl_max; @@ -5966,13 +5966,13 @@ dcm_tag_is_open(dcm_state_pdv_t *pdv, guint32 startpos, guint32 offset, guint32 if (offset + size_required > endpos) { - pdv->open_tag.is_header_fragmented = TRUE; - pdv->open_tag.len_decoded = endpos - startpos; + pdv->open_tag.is_header_fragmented = TRUE; + pdv->open_tag.len_decoded = endpos - startpos; - return TRUE; + return TRUE; } else { - return FALSE; + return FALSE; } } @@ -5982,53 +5982,53 @@ dcm_tag_lookup(guint16 grp, guint16 elm) static dcm_tag_t *tag_def = NULL; - static dcm_tag_t tag_unknown = { 0x00000000, "(unknown)", "UN", "1", 0, 0}; - static dcm_tag_t tag_private = { 0x00000000, "Private Tag", "UN", "1", 0, 0 }; + static dcm_tag_t tag_unknown = { 0x00000000, "(unknown)", "UN", "1", 0, 0}; + static dcm_tag_t tag_private = { 0x00000000, "Private Tag", "UN", "1", 0, 0 }; static dcm_tag_t tag_private_grp_len = { 0x00000000, "Private Tag Group Length", "UL", "1", 0, 0 }; - static dcm_tag_t tag_grp_length = { 0x00000000, "Group Length", "UL", "1", 0, 0 }; + static dcm_tag_t tag_grp_length = { 0x00000000, "Group Length", "UL", "1", 0, 0 }; /* Try a direct hit first before doing a masked search */ tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | elm)); if (tag_def == NULL) { - /* No match found */ - if ((grp & 0x0001) && (elm == 0x0000)) { - tag_def = &tag_private_grp_len; - } - else if (grp & 0x0001) { - tag_def = &tag_private; - } - else if (elm == 0x0000) { - tag_def = &tag_grp_length; - } + /* No match found */ + if ((grp & 0x0001) && (elm == 0x0000)) { + tag_def = &tag_private_grp_len; + } + else if (grp & 0x0001) { + tag_def = &tag_private; + } + else if (elm == 0x0000) { + tag_def = &tag_grp_length; + } /* There are a few tags that require a mask to be found */ - else if (((grp & 0xFF00) == 0x5000) || ((grp & 0xFF00) == 0x6000) || ((grp & 0xFF00) == 0x7F00)) { - /* Do a special for groups 0x50xx, 0x60xx and 0x7Fxx */ - tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER(((grp & 0xFF00) << 16) | elm)); - } - else if ((grp == 0x0020) && ((elm & 0xFF00) == 0x3100)) { - tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0xFF00))); - } - else if ((grp == 0x0028) && ((elm & 0xFF00) == 0x0400)) { - /* This map was done to 0x041x */ - tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0xFF0F) | 0x0010)); - } - else if ((grp == 0x0028) && ((elm & 0xFF00) == 0x0800)) { - tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0xFF0F))); - } - else if (grp == 0x1000) { - tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0x000F))); - } - else if (grp == 0x1010) { - tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0x0000))); - } + else if (((grp & 0xFF00) == 0x5000) || ((grp & 0xFF00) == 0x6000) || ((grp & 0xFF00) == 0x7F00)) { + /* Do a special for groups 0x50xx, 0x60xx and 0x7Fxx */ + tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER(((grp & 0xFF00) << 16) | elm)); + } + else if ((grp == 0x0020) && ((elm & 0xFF00) == 0x3100)) { + tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0xFF00))); + } + else if ((grp == 0x0028) && ((elm & 0xFF00) == 0x0400)) { + /* This map was done to 0x041x */ + tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0xFF0F) | 0x0010)); + } + else if ((grp == 0x0028) && ((elm & 0xFF00) == 0x0800)) { + tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0xFF0F))); + } + else if (grp == 0x1000) { + tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0x000F))); + } + else if (grp == 0x1010) { + tag_def = (dcm_tag_t *)g_hash_table_lookup(dcm_tag_table, GUINT_TO_POINTER((grp << 16) | (elm & 0x0000))); + } if (tag_def == NULL) { - /* Still no match found */ - tag_def = &tag_unknown; - } + /* Still no match found */ + tag_def = &tag_unknown; + } } return tag_def; @@ -6036,7 +6036,7 @@ dcm_tag_lookup(guint16 grp, guint16 elm) static gchar* dcm_tag_summary(guint16 grp, guint16 elm, guint32 vl, const gchar *tag_desc, const gchar *vr, - gboolean is_retired, gboolean is_implicit) + gboolean is_retired, gboolean is_implicit) { gchar *desc_mod; @@ -6044,54 +6044,54 @@ dcm_tag_summary(guint16 grp, guint16 elm, guint32 vl, const gchar *tag_desc, con gchar *tag_sum; if (is_retired) { - desc_mod = wmem_strdup_printf(wmem_packet_scope(), "(Retired) %-35.35s", tag_desc); + desc_mod = wmem_strdup_printf(wmem_packet_scope(), "(Retired) %-35.35s", tag_desc); } else { - desc_mod = wmem_strdup_printf(wmem_packet_scope(), "%-45.45s", tag_desc); + desc_mod = wmem_strdup_printf(wmem_packet_scope(), "%-45.45s", tag_desc); } if (vl == 0xFFFFFFFF) { - tag_vl = wmem_strdup_printf(wmem_packet_scope(), "%10.10s", "<udef>"); + tag_vl = wmem_strdup_printf(wmem_packet_scope(), "%10.10s", "<udef>"); } else { - tag_vl = wmem_strdup_printf(wmem_packet_scope(), "%10u", vl); /* Show as dec */ + tag_vl = wmem_strdup_printf(wmem_packet_scope(), "%10u", vl); /* Show as dec */ } - if (is_implicit) tag_sum = wmem_strdup_printf(wmem_packet_scope(), "(%04x,%04x) %s %s", grp, elm, tag_vl, desc_mod); - else tag_sum = wmem_strdup_printf(wmem_packet_scope(), "(%04x,%04x) %s %s [%s]", grp, elm, tag_vl, desc_mod, vr); + if (is_implicit) tag_sum = wmem_strdup_printf(wmem_packet_scope(), "(%04x,%04x) %s %s", grp, elm, tag_vl, desc_mod); + else tag_sum = wmem_strdup_printf(wmem_packet_scope(), "(%04x,%04x) %s %s [%s]", grp, elm, tag_vl, desc_mod, vr); return tag_sum; } static guint32 dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - dcm_state_pdv_t *pdv, guint32 offset, guint32 endpos, - gboolean is_first_tag, const gchar **tag_description, - gboolean *end_of_seq_or_item) + dcm_state_pdv_t *pdv, guint32 offset, guint32 endpos, + gboolean is_first_tag, const gchar **tag_description, + gboolean *end_of_seq_or_item) { /* Decode one tag. If it is a sequence or item start create a subtree. Returns new offset. */ - proto_tree *tag_ptree = NULL; /* Tree for decoded tag details */ - proto_tree *seq_ptree = NULL; /* Possible subtree for sequences and items */ + proto_tree *tag_ptree = NULL; /* Tree for decoded tag details */ + proto_tree *seq_ptree = NULL; /* Possible subtree for sequences and items */ proto_item *tag_pitem = NULL; dcm_tag_t *tag_def = NULL; const gchar *vr = NULL; - gchar *tag_value = NULL; /* Tag Value converted to a string */ + gchar *tag_value = NULL; /* Tag Value converted to a string */ gchar *tag_summary; guint32 vl = 0; guint16 vl_1 = 0; guint16 vl_2 = 0; - guint32 offset_tag = 0; /* Remember offsets for tree, since the tree */ - guint32 offset_vr = 0; /* header is created pretty late */ + guint32 offset_tag = 0; /* Remember offsets for tree, since the tree */ + guint32 offset_vr = 0; /* header is created pretty late */ guint32 offset_vl = 0; - guint32 vl_max = 0; /* Max Value Length to Parse */ + guint32 vl_max = 0; /* Max Value Length to Parse */ guint16 grp = 0; guint16 elm = 0; @@ -6100,27 +6100,27 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_little_endian = FALSE; gboolean is_implicit = FALSE; - gboolean is_vl_long = FALSE; /* True for 4 Bytes length fields */ + gboolean is_vl_long = FALSE; /* True for 4 Bytes length fields */ - gboolean is_sequence = FALSE; /* True for Sequence Tags */ - gboolean is_item = FALSE; /* True for Sequence Item Tags */ + gboolean is_sequence = FALSE; /* True for Sequence Tags */ + gboolean is_item = FALSE; /* True for Sequence Item Tags */ - *tag_description = NULL; /* Reset description. It's ep_ memory, so not really bad*/ + *tag_description = NULL; /* Reset description. It's ep_ memory, so not really bad*/ tag_value = (gchar *)wmem_alloc0(wmem_packet_scope(), MAX_BUF_LEN); /* Decode the syntax a little more */ - if (pdv->syntax == DCM_EBE) is_little_endian = FALSE; - else is_little_endian = TRUE; + if (pdv->syntax == DCM_EBE) is_little_endian = FALSE; + else is_little_endian = TRUE; if (pdv->syntax == DCM_ILE) is_implicit = TRUE; - else is_implicit = FALSE; + else is_implicit = FALSE; offset_tag = offset; if (pdv->prev && is_first_tag) { - len_decoded_remaing = pdv->prev->open_tag.len_decoded; + len_decoded_remaing = pdv->prev->open_tag.len_decoded; } @@ -6145,32 +6145,32 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Group */ if (len_decoded_remaing >= 2) { - grp = pdv->prev->open_tag.grp; - len_decoded_remaing -= 2; + grp = pdv->prev->open_tag.grp; + len_decoded_remaing -= 2; } else { - if (dcm_tag_is_open(pdv, offset_tag, offset, endpos, 2)) return endpos; /* Exit if needed */ + if (dcm_tag_is_open(pdv, offset_tag, offset, endpos, 2)) return endpos; /* Exit if needed */ - if (is_little_endian) grp = tvb_get_letohs(tvb, offset); - else grp = tvb_get_ntohs (tvb, offset); - offset += 2; - pdv->open_tag.grp = grp; + if (is_little_endian) grp = tvb_get_letohs(tvb, offset); + else grp = tvb_get_ntohs (tvb, offset); + offset += 2; + pdv->open_tag.grp = grp; } /* Element */ if (len_decoded_remaing >= 2) { - elm = pdv->prev->open_tag.elm; - len_decoded_remaing -= 2; + elm = pdv->prev->open_tag.elm; + len_decoded_remaing -= 2; } else { - if (dcm_tag_is_open(pdv, offset_tag, offset, endpos, 2)) return endpos; /* Exit if needed */ + if (dcm_tag_is_open(pdv, offset_tag, offset, endpos, 2)) return endpos; /* Exit if needed */ - if (is_little_endian) elm = tvb_get_letohs(tvb, offset); - else elm = tvb_get_ntohs (tvb, offset); - offset += 2; - pdv->open_tag.elm = elm; + if (is_little_endian) elm = tvb_get_letohs(tvb, offset); + else elm = tvb_get_ntohs (tvb, offset); + offset += 2; + pdv->open_tag.elm = elm; } /* Find the best matching tag */ @@ -6179,51 +6179,51 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Value Representation */ offset_vr = offset; if ((grp == 0xFFFE) && (elm == 0xE000 || elm == 0xE00D || elm == 0xE0DD)) { - /* Item start, Item Delimitation or Sequence Delimitation */ - vr = "UL"; - is_vl_long = TRUE; /* These tags always have a 4 byte length field */ + /* Item start, Item Delimitation or Sequence Delimitation */ + vr = "UL"; + is_vl_long = TRUE; /* These tags always have a 4 byte length field */ } else if (is_implicit) { - /* Get VR from tag definition */ - vr = wmem_strdup(wmem_packet_scope(), tag_def->vr); - is_vl_long = TRUE; /* Implicit always has 4 byte length field */ + /* Get VR from tag definition */ + vr = wmem_strdup(wmem_packet_scope(), tag_def->vr); + is_vl_long = TRUE; /* Implicit always has 4 byte length field */ } else { - if (len_decoded_remaing >= 2) { - vr = wmem_strdup(wmem_packet_scope(), pdv->prev->open_tag.vr); - len_decoded_remaing -= 2; - } - else { - - /* Controlled exit, if VR does not fit. */ - if (dcm_tag_is_open(pdv, offset_tag, offset_vr, endpos, 2)) return endpos; - - vr = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 2, ENC_ASCII); - offset += 2; - - g_free(pdv->open_tag.vr); - pdv->open_tag.vr = g_strdup(vr); /* needs to survive withing a session */ - } - - - if ((strcmp(vr, "OB") == 0) || (strcmp(vr, "OW") == 0) || (strcmp(vr, "OF") == 0) || - (strcmp(vr, "SQ") == 0) || (strcmp(vr, "UT") == 0) || (strcmp(vr, "UN") == 0)) { - /* 4 bytes specials: OB, OW, OF, SQ, UT or UN */ - is_vl_long = TRUE; - - /* Skip 2 Bytes */ - if (len_decoded_remaing >= 2) { - len_decoded_remaing -= 2; - } - else { - if (dcm_tag_is_open(pdv, offset_tag, offset_vr, endpos, 2)) return endpos; - offset += 2; - } - } - else { - is_vl_long = FALSE; - } + if (len_decoded_remaing >= 2) { + vr = wmem_strdup(wmem_packet_scope(), pdv->prev->open_tag.vr); + len_decoded_remaing -= 2; + } + else { + + /* Controlled exit, if VR does not fit. */ + if (dcm_tag_is_open(pdv, offset_tag, offset_vr, endpos, 2)) return endpos; + + vr = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 2, ENC_ASCII); + offset += 2; + + g_free(pdv->open_tag.vr); + pdv->open_tag.vr = g_strdup(vr); /* needs to survive withing a session */ + } + + + if ((strcmp(vr, "OB") == 0) || (strcmp(vr, "OW") == 0) || (strcmp(vr, "OF") == 0) || + (strcmp(vr, "SQ") == 0) || (strcmp(vr, "UT") == 0) || (strcmp(vr, "UN") == 0)) { + /* 4 bytes specials: OB, OW, OF, SQ, UT or UN */ + is_vl_long = TRUE; + + /* Skip 2 Bytes */ + if (len_decoded_remaing >= 2) { + len_decoded_remaing -= 2; + } + else { + if (dcm_tag_is_open(pdv, offset_tag, offset_vr, endpos, 2)) return endpos; + offset += 2; + } + } + else { + is_vl_long = FALSE; + } } @@ -6233,37 +6233,37 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset_vl = offset; if (len_decoded_remaing >= 2) { - vl_1 = pdv->prev->open_tag.vl_1; - len_decoded_remaing -= 2; + vl_1 = pdv->prev->open_tag.vl_1; + len_decoded_remaing -= 2; } else { - if (dcm_tag_is_open(pdv, offset_tag, offset_vl, endpos, 2)) return endpos; - if (is_little_endian) vl_1 = tvb_get_letohs(tvb, offset); - else vl_1 = tvb_get_ntohs(tvb, offset); - offset += 2; - pdv->open_tag.vl_1 = vl_1; + if (dcm_tag_is_open(pdv, offset_tag, offset_vl, endpos, 2)) return endpos; + if (is_little_endian) vl_1 = tvb_get_letohs(tvb, offset); + else vl_1 = tvb_get_ntohs(tvb, offset); + offset += 2; + pdv->open_tag.vl_1 = vl_1; } if (is_vl_long) { - if (len_decoded_remaing >= 2) { - vl_2 = pdv->prev->open_tag.vl_2; - } - else { + if (len_decoded_remaing >= 2) { + vl_2 = pdv->prev->open_tag.vl_2; + } + else { - if (dcm_tag_is_open(pdv, offset_tag, offset_vl+2, endpos, 2)) return endpos; - if (is_little_endian) vl_2 = tvb_get_letohs(tvb, offset); - else vl_2 = tvb_get_ntohs(tvb, offset); - offset += 2; - pdv->open_tag.vl_2 = vl_2; - } + if (dcm_tag_is_open(pdv, offset_tag, offset_vl+2, endpos, 2)) return endpos; + if (is_little_endian) vl_2 = tvb_get_letohs(tvb, offset); + else vl_2 = tvb_get_ntohs(tvb, offset); + offset += 2; + pdv->open_tag.vl_2 = vl_2; + } - if (is_little_endian) vl = (vl_2 << 16) + vl_1; - else vl = (vl_1 << 16) + vl_2; + if (is_little_endian) vl = (vl_2 << 16) + vl_1; + else vl = (vl_1 << 16) + vl_2; } else { - vl = vl_1; + vl = vl_1; } /* Now we have most of the information, except for sequences and items with undefined @@ -6281,65 +6281,65 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, is_sequence = (strcmp(vr, "SQ") == 0) || (vl == 0xFFFFFFFF); is_item = ((grp == 0xFFFE) && (elm == 0xE000)); - if (vl == 0xFFFFFFFF) { - /* 'Just' mark header as the length of the item */ - tag_ptree = proto_tree_add_subtree(tree, tvb, offset_tag, offset - offset_tag, - is_item ? ett_dcm_data_item : ett_dcm_data_seq, &tag_pitem, tag_summary); - vl_max = 0; /* We don't know who long this sequence/item is */ - } - else if (offset + vl <= endpos) { - /* Show real length of item */ - tag_ptree = proto_tree_add_subtree(tree, tvb, offset_tag, offset + vl - offset_tag, - is_item ? ett_dcm_data_item : ett_dcm_data_seq, &tag_pitem, tag_summary); - vl_max = vl; - } - else { - /* Value is longer than what we have in the PDV, -> we do have a OPEN tag */ - tag_ptree = proto_tree_add_subtree(tree, tvb, offset_tag, endpos - offset_tag, - is_item ? ett_dcm_data_item : ett_dcm_data_seq, &tag_pitem, tag_summary); - vl_max = endpos - offset; - } + if (vl == 0xFFFFFFFF) { + /* 'Just' mark header as the length of the item */ + tag_ptree = proto_tree_add_subtree(tree, tvb, offset_tag, offset - offset_tag, + is_item ? ett_dcm_data_item : ett_dcm_data_seq, &tag_pitem, tag_summary); + vl_max = 0; /* We don't know who long this sequence/item is */ + } + else if (offset + vl <= endpos) { + /* Show real length of item */ + tag_ptree = proto_tree_add_subtree(tree, tvb, offset_tag, offset + vl - offset_tag, + is_item ? ett_dcm_data_item : ett_dcm_data_seq, &tag_pitem, tag_summary); + vl_max = vl; + } + else { + /* Value is longer than what we have in the PDV, -> we do have a OPEN tag */ + tag_ptree = proto_tree_add_subtree(tree, tvb, offset_tag, endpos - offset_tag, + is_item ? ett_dcm_data_item : ett_dcm_data_seq, &tag_pitem, tag_summary); + vl_max = endpos - offset; + } /* If you are going to touch the following 25 lines, make sure you reserve a few hours to go through both display options and check for proper tree display :-) */ - if (is_sequence | is_item) { - - if (global_dcm_seq_subtree) { - if (!global_dcm_tag_subtree) - tag_ptree = NULL; - } - else { - seq_ptree = tree; - if (!global_dcm_tag_subtree) { - tag_ptree = NULL; - } - } - } - else { - /* For tags */ - if (!global_dcm_tag_subtree) { - tag_ptree = NULL; - } - } - - /* --------------------------------------------------------------- - Tag details as separate items - --------------------------------------------------------------- - */ + if (is_sequence | is_item) { + + if (global_dcm_seq_subtree) { + if (!global_dcm_tag_subtree) + tag_ptree = NULL; + } + else { + seq_ptree = tree; + if (!global_dcm_tag_subtree) { + tag_ptree = NULL; + } + } + } + else { + /* For tags */ + if (!global_dcm_tag_subtree) { + tag_ptree = NULL; + } + } + + /* --------------------------------------------------------------- + Tag details as separate items + --------------------------------------------------------------- + */ proto_tree_add_uint_format_value(tag_ptree, hf_dcm_tag, tvb, offset_tag, 4, (grp << 16) | elm, "%04x,%04x (%s)", grp, elm, tag_def->description); /* Add VR to tag detail, except for dicom items */ if (!is_item) { - if (is_implicit) { - /* Select header, since no VR is present in implicit syntax */ - proto_tree_add_string_format(tag_ptree, hf_dcm_tag_vr, tvb, offset_tag, 4, vr, "%-8.8s%s", "VR:", vr); - } - else { - proto_tree_add_string_format(tag_ptree, hf_dcm_tag_vr, tvb, offset_vr, 2, vr, "%-8.8s%s", "VR:", vr); - } + if (is_implicit) { + /* Select header, since no VR is present in implicit syntax */ + proto_tree_add_string_format(tag_ptree, hf_dcm_tag_vr, tvb, offset_tag, 4, vr, "%-8.8s%s", "VR:", vr); + } + else { + proto_tree_add_string_format(tag_ptree, hf_dcm_tag_vr, tvb, offset_vr, 2, vr, "%-8.8s%s", "VR:", vr); + } } /* Add length to tag detail */ @@ -6347,108 +6347,108 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* --------------------------------------------------------------- - Finally the Tag Value - --------------------------------------------------------------- + Finally the Tag Value + --------------------------------------------------------------- */ if ((is_sequence || is_item) && (vl > 0)) { - /* Sequence or Item Start */ + /* Sequence or Item Start */ - guint32 endpos_item = 0; - gboolean local_end_of_seq_or_item = FALSE; - gboolean is_first_desc = TRUE; + guint32 endpos_item = 0; + gboolean local_end_of_seq_or_item = FALSE; + gboolean is_first_desc = TRUE; - const gchar *item_description = NULL; /* Will be allocated as ep_ memory in dissect_dcm_tag() */ + const gchar *item_description = NULL; /* Will be allocated as ep_ memory in dissect_dcm_tag() */ - if (vl == 0xFFFFFFFF) { - /* Undefined length */ + if (vl == 0xFFFFFFFF) { + /* Undefined length */ - while ((!local_end_of_seq_or_item) && (!pdv->open_tag.is_header_fragmented) && (offset < endpos)) { + while ((!local_end_of_seq_or_item) && (!pdv->open_tag.is_header_fragmented) && (offset < endpos)) { - offset = dissect_dcm_tag(tvb, pinfo, seq_ptree, pdv, offset, endpos, FALSE, - &item_description, &local_end_of_seq_or_item); + offset = dissect_dcm_tag(tvb, pinfo, seq_ptree, pdv, offset, endpos, FALSE, + &item_description, &local_end_of_seq_or_item); - if (item_description && global_dcm_seq_subtree) { - proto_item_append_text(tag_pitem, (is_first_desc ? " %s" : ", %s"), item_description); - is_first_desc = FALSE; - } - } - } - else { - /* Defined length */ - endpos_item = offset + vl_max; + if (item_description && global_dcm_seq_subtree) { + proto_item_append_text(tag_pitem, (is_first_desc ? " %s" : ", %s"), item_description); + is_first_desc = FALSE; + } + } + } + else { + /* Defined length */ + endpos_item = offset + vl_max; - while (offset < endpos_item) { + while (offset < endpos_item) { - offset = dissect_dcm_tag(tvb, pinfo, seq_ptree, pdv, offset, endpos_item, FALSE, - &item_description, &local_end_of_seq_or_item); + offset = dissect_dcm_tag(tvb, pinfo, seq_ptree, pdv, offset, endpos_item, FALSE, + &item_description, &local_end_of_seq_or_item); - if (item_description && global_dcm_seq_subtree) { - proto_item_append_text(tag_pitem, (is_first_desc ? " %s" : ", %s"), item_description); - is_first_desc = FALSE; - } - } - } + if (item_description && global_dcm_seq_subtree) { + proto_item_append_text(tag_pitem, (is_first_desc ? " %s" : ", %s"), item_description); + is_first_desc = FALSE; + } + } + } } /* if ((is_sequence || is_item) && (vl > 0)) */ else if ((grp == 0xFFFE) && (elm == 0xE00D)) { - /* Item delimitation for items with undefined length */ - *end_of_seq_or_item = TRUE; + /* Item delimitation for items with undefined length */ + *end_of_seq_or_item = TRUE; } else if ((grp == 0xFFFE) && (elm == 0xE0DD)) { - /* Sequence delimitation for sequences with undefined length */ - *end_of_seq_or_item = TRUE; + /* Sequence delimitation for sequences with undefined length */ + *end_of_seq_or_item = TRUE; } else if (vl == 0) { - /* No value */ - g_strlcpy(tag_value, "<Empty>", MAX_BUF_LEN); + /* No value */ + g_strlcpy(tag_value, "<Empty>", MAX_BUF_LEN); } else if (vl > vl_max) { - /* Tag is longer than the PDV/PDU. Don't perform any decoding */ + /* Tag is longer than the PDV/PDU. Don't perform any decoding */ - gchar *tag_desc; + gchar *tag_desc; proto_tree_add_bytes_format(tag_ptree, hf_dcm_tag_value_byte, tvb, offset, vl_max, - NULL, "%-8.8sBytes %d - %d [start]", "Value:", 1, vl_max); + NULL, "%-8.8sBytes %d - %d [start]", "Value:", 1, vl_max); - g_snprintf(tag_value, MAX_BUF_LEN, "<Bytes %d - %d, start>", 1, vl_max); - offset += vl_max; + g_snprintf(tag_value, MAX_BUF_LEN, "<Bytes %d - %d, start>", 1, vl_max); + offset += vl_max; - /* Save the needed data for reuse, and subsequent packets - This will leak a little within the session. + /* Save the needed data for reuse, and subsequent packets + This will leak a little within the session. - But since we may have tags being closed and reopen in the same PDV - we will always need to store this - */ + But since we may have tags being closed and reopen in the same PDV + we will always need to store this + */ - tag_desc = dcm_tag_summary(grp, elm, vl, tag_def->description, vr, tag_def->is_retired, is_implicit); + tag_desc = dcm_tag_summary(grp, elm, vl, tag_def->description, vr, tag_def->is_retired, is_implicit); - if (pdv->open_tag.desc == NULL) { - pdv->open_tag.is_value_fragmented = TRUE; - pdv->open_tag.desc = wmem_strdup(wmem_file_scope(), tag_desc); - pdv->open_tag.len_total = vl; - pdv->open_tag.len_remaining = vl - vl_max; - } + if (pdv->open_tag.desc == NULL) { + pdv->open_tag.is_value_fragmented = TRUE; + pdv->open_tag.desc = wmem_strdup(wmem_file_scope(), tag_desc); + pdv->open_tag.len_total = vl; + pdv->open_tag.len_remaining = vl - vl_max; + } } else { - /* Regular value. Identify the type, decode and display */ - - offset = dissect_dcm_tag_value(tvb, pinfo, tag_ptree, pdv, offset, grp, elm, vl, vl_max, vr, &tag_value); - - /* ------------------------------------------------------------- - We have decoded the value. Now store those tags of interest - ------------------------------------------------------------- - */ - - /* Store SOP Class and Instance UID in first PDV of this object */ - if (grp == 0x0008 && elm == 0x0016) { - dcm_state_pdv_get_obj_start(pdv)->sop_class_uid = wmem_strdup(wmem_file_scope(), tag_value); - } - else if (grp == 0x0008 && elm == 0x0018) { - dcm_state_pdv_get_obj_start(pdv)->sop_instance_uid = wmem_strdup(wmem_file_scope(), tag_value); - } - else if (grp == 0x0000 && elm == 0x0100) { - /* This is the command tag -> overwrite existing PDV description */ - pdv->desc = wmem_strdup(wmem_file_scope(), tag_value); - } + /* Regular value. Identify the type, decode and display */ + + offset = dissect_dcm_tag_value(tvb, pinfo, tag_ptree, pdv, offset, grp, elm, vl, vl_max, vr, &tag_value); + + /* ------------------------------------------------------------- + We have decoded the value. Now store those tags of interest + ------------------------------------------------------------- + */ + + /* Store SOP Class and Instance UID in first PDV of this object */ + if (grp == 0x0008 && elm == 0x0016) { + dcm_state_pdv_get_obj_start(pdv)->sop_class_uid = wmem_strdup(wmem_file_scope(), tag_value); + } + else if (grp == 0x0008 && elm == 0x0018) { + dcm_state_pdv_get_obj_start(pdv)->sop_instance_uid = wmem_strdup(wmem_file_scope(), tag_value); + } + else if (grp == 0x0000 && elm == 0x0100) { + /* This is the command tag -> overwrite existing PDV description */ + pdv->desc = wmem_strdup(wmem_file_scope(), tag_value); + } } @@ -6460,7 +6460,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item_append_text(tag_pitem, " %s", tag_value); if (tag_def->add_to_summary) { - *tag_description = wmem_strdup(wmem_packet_scope(), g_strstrip(tag_value)); + *tag_description = wmem_strdup(wmem_packet_scope(), g_strstrip(tag_value)); } return offset; @@ -6468,7 +6468,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static guint32 dissect_dcm_tag_open(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - dcm_state_pdv_t *pdv, guint32 offset, guint32 endpos, gboolean *is_first_tag) + dcm_state_pdv_t *pdv, guint32 offset, guint32 endpos, gboolean *is_first_tag) { /* 'Decode' open tags from previous PDV */ @@ -6477,65 +6477,65 @@ dissect_dcm_tag_open(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 tag_value_fragment_len = 0; if ((pdv->prev) && (pdv->prev->open_tag.len_remaining > 0)) { - /* Not first PDV in the given presentation context (Those don't have remaining data to parse :-) */ - /* And previous PDV has left overs, i.e. this is a continuation PDV */ - - if (endpos - offset >= pdv->prev->open_tag.len_remaining) { - /* - Remaining bytes are equal or more than we expect for the open tag - Finally reach the end of this tag. Don't touch the open_tag structure - of this PDV, as we may see a new open tag at the end - */ - tag_value_fragment_len = pdv->prev->open_tag.len_remaining; - pdv->is_corrupt = FALSE; - } - else if (pdv->is_flagvalid && pdv->is_last_fragment) { - /* - The tag is not yet complete, however, the flag indicates that it should be - Therefore end this tag and issue an expert_add_info. Don't touch the - open_tag structure of this PDV, as we may see a new open tag at the end - */ - tag_value_fragment_len = endpos - offset; - pdv->is_corrupt = TRUE; - } - else { - /* - * More to do for this tag - */ - tag_value_fragment_len = endpos - offset; - - /* Set data in current PDV structure */ - if (!pdv->open_tag.is_value_fragmented) { - /* No need to do it twice or more */ - - pdv->open_tag.is_value_fragmented = TRUE; - pdv->open_tag.len_total = pdv->prev->open_tag.len_total; - pdv->open_tag.len_remaining = pdv->prev->open_tag.len_remaining - tag_value_fragment_len; - pdv->open_tag.desc = wmem_strdup(wmem_file_scope(), pdv->prev->open_tag.desc); - - } - pdv->is_corrupt = FALSE; - } - - if (pdv->is_corrupt) { - pitem = proto_tree_add_bytes_format(tree, hf_dcm_data_tag, tvb, - offset, tag_value_fragment_len, NULL, - "%s <incomplete>", pdv->prev->open_tag.desc); - - expert_add_info(pinfo, pitem, &ei_dcm_data_tag); - - } - else { - proto_tree_add_bytes_format(tree, hf_dcm_data_tag, tvb, - offset, tag_value_fragment_len, NULL, - "%s <Bytes %d - %d, %s>", pdv->prev->open_tag.desc, - pdv->prev->open_tag.len_total - pdv->prev->open_tag.len_remaining + 1, - pdv->prev->open_tag.len_total - pdv->prev->open_tag.len_remaining + tag_value_fragment_len, - (pdv->prev->open_tag.len_remaining > tag_value_fragment_len ? "continuation" : "end") ); - } - - offset += tag_value_fragment_len; - *is_first_tag = FALSE; + /* Not first PDV in the given presentation context (Those don't have remaining data to parse :-) */ + /* And previous PDV has left overs, i.e. this is a continuation PDV */ + + if (endpos - offset >= pdv->prev->open_tag.len_remaining) { + /* + Remaining bytes are equal or more than we expect for the open tag + Finally reach the end of this tag. Don't touch the open_tag structure + of this PDV, as we may see a new open tag at the end + */ + tag_value_fragment_len = pdv->prev->open_tag.len_remaining; + pdv->is_corrupt = FALSE; + } + else if (pdv->is_flagvalid && pdv->is_last_fragment) { + /* + The tag is not yet complete, however, the flag indicates that it should be + Therefore end this tag and issue an expert_add_info. Don't touch the + open_tag structure of this PDV, as we may see a new open tag at the end + */ + tag_value_fragment_len = endpos - offset; + pdv->is_corrupt = TRUE; + } + else { + /* + * More to do for this tag + */ + tag_value_fragment_len = endpos - offset; + + /* Set data in current PDV structure */ + if (!pdv->open_tag.is_value_fragmented) { + /* No need to do it twice or more */ + + pdv->open_tag.is_value_fragmented = TRUE; + pdv->open_tag.len_total = pdv->prev->open_tag.len_total; + pdv->open_tag.len_remaining = pdv->prev->open_tag.len_remaining - tag_value_fragment_len; + pdv->open_tag.desc = wmem_strdup(wmem_file_scope(), pdv->prev->open_tag.desc); + + } + pdv->is_corrupt = FALSE; + } + + if (pdv->is_corrupt) { + pitem = proto_tree_add_bytes_format(tree, hf_dcm_data_tag, tvb, + offset, tag_value_fragment_len, NULL, + "%s <incomplete>", pdv->prev->open_tag.desc); + + expert_add_info(pinfo, pitem, &ei_dcm_data_tag); + + } + else { + proto_tree_add_bytes_format(tree, hf_dcm_data_tag, tvb, + offset, tag_value_fragment_len, NULL, + "%s <Bytes %d - %d, %s>", pdv->prev->open_tag.desc, + pdv->prev->open_tag.len_total - pdv->prev->open_tag.len_remaining + 1, + pdv->prev->open_tag.len_total - pdv->prev->open_tag.len_remaining + tag_value_fragment_len, + (pdv->prev->open_tag.len_remaining > tag_value_fragment_len ? "continuation" : "end") ); + } + + offset += tag_value_fragment_len; + *is_first_tag = FALSE; } return offset; @@ -6543,8 +6543,8 @@ dissect_dcm_tag_open(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static guint32 dissect_dcm_pdv_body(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - dcm_state_pdv_t *pdv, guint32 offset, guint32 pdv_body_len, - gchar **pdv_description) + dcm_state_pdv_t *pdv, guint32 offset, guint32 pdv_body_len, + gchar **pdv_description) { /* Handle one PDV inside a data PDU */ @@ -6555,81 +6555,81 @@ dissect_dcm_pdv_body(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, endpos = offset + pdv_body_len; if (pdv->syntax == DCM_UNK) { - /* Eventually, we will have a syntax detector. Until then, don't decode */ + /* Eventually, we will have a syntax detector. Until then, don't decode */ - proto_tree_add_bytes_format(tree, hf_dcm_data_tag, tvb, - offset, pdv_body_len, NULL, - "(%04x,%04x) %-8x Unparsed data", 0, 0, pdv_body_len); + proto_tree_add_bytes_format(tree, hf_dcm_data_tag, tvb, + offset, pdv_body_len, NULL, + "(%04x,%04x) %-8x Unparsed data", 0, 0, pdv_body_len); } else { - gboolean is_first_tag = TRUE; + gboolean is_first_tag = TRUE; - /* Treat the left overs */ - offset = dissect_dcm_tag_open(tvb, pinfo, tree, pdv, offset, endpos, &is_first_tag); + /* Treat the left overs */ + offset = dissect_dcm_tag_open(tvb, pinfo, tree, pdv, offset, endpos, &is_first_tag); - /* Decode all tags, sequences and items in this PDV recursively */ - while (offset < endpos) { - offset = dissect_dcm_tag(tvb, pinfo, tree, pdv, offset, endpos, is_first_tag, &tag_value, &dummy); - is_first_tag = FALSE; - } + /* Decode all tags, sequences and items in this PDV recursively */ + while (offset < endpos) { + offset = dissect_dcm_tag(tvb, pinfo, tree, pdv, offset, endpos, is_first_tag, &tag_value, &dummy); + is_first_tag = FALSE; + } } if (pdv->is_command) { - *pdv_description = (gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); - - if (pdv->is_warning) { - if (pdv->comment) { - g_snprintf(*pdv_description, MAX_BUF_LEN, "%s (%s, %s)", pdv->desc, pdv->status, pdv->comment); - } - else { - g_snprintf(*pdv_description, MAX_BUF_LEN, "%s (%s)", pdv->desc, pdv->status); - } - - } - else if (global_dcm_cmd_details) { - /* Show command details in header */ - - if (pdv->message_id > 0) { - g_snprintf(*pdv_description, MAX_BUF_LEN, "%s ID=%d", pdv->desc, pdv->message_id); - } - else if (pdv->message_id_resp > 0) { - - g_snprintf(*pdv_description, MAX_BUF_LEN, "%s ID=%d", pdv->desc, pdv->message_id_resp); - - if (pdv->no_completed > 0) { - g_snprintf(*pdv_description, MAX_BUF_LEN, "%s C=%d", *pdv_description, pdv->no_completed); - } - if (pdv->no_remaining > 0) { - g_snprintf(*pdv_description, MAX_BUF_LEN, "%s R=%d", *pdv_description, pdv->no_remaining); - } - if (pdv->no_warning > 0) { - g_snprintf(*pdv_description, MAX_BUF_LEN, "%s W=%d", *pdv_description, pdv->no_warning); - } - if (pdv->no_failed > 0) { - g_snprintf(*pdv_description, MAX_BUF_LEN, "%s F=%d", *pdv_description, pdv->no_failed); - } - } - else { - *pdv_description = pdv->desc; - } - } - else { - *pdv_description = pdv->desc; - } + *pdv_description = (gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); + + if (pdv->is_warning) { + if (pdv->comment) { + g_snprintf(*pdv_description, MAX_BUF_LEN, "%s (%s, %s)", pdv->desc, pdv->status, pdv->comment); + } + else { + g_snprintf(*pdv_description, MAX_BUF_LEN, "%s (%s)", pdv->desc, pdv->status); + } + + } + else if (global_dcm_cmd_details) { + /* Show command details in header */ + + if (pdv->message_id > 0) { + g_snprintf(*pdv_description, MAX_BUF_LEN, "%s ID=%d", pdv->desc, pdv->message_id); + } + else if (pdv->message_id_resp > 0) { + + g_snprintf(*pdv_description, MAX_BUF_LEN, "%s ID=%d", pdv->desc, pdv->message_id_resp); + + if (pdv->no_completed > 0) { + g_snprintf(*pdv_description, MAX_BUF_LEN, "%s C=%d", *pdv_description, pdv->no_completed); + } + if (pdv->no_remaining > 0) { + g_snprintf(*pdv_description, MAX_BUF_LEN, "%s R=%d", *pdv_description, pdv->no_remaining); + } + if (pdv->no_warning > 0) { + g_snprintf(*pdv_description, MAX_BUF_LEN, "%s W=%d", *pdv_description, pdv->no_warning); + } + if (pdv->no_failed > 0) { + g_snprintf(*pdv_description, MAX_BUF_LEN, "%s F=%d", *pdv_description, pdv->no_failed); + } + } + else { + *pdv_description = pdv->desc; + } + } + else { + *pdv_description = pdv->desc; + } } else { - *pdv_description = pdv->desc; + *pdv_description = pdv->desc; } - return endpos; /* we could try offset as return value */ + return endpos; /* we could try offset as return value */ } static guint32 dissect_dcm_pdv_fragmented(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - dcm_state_assoc_t *assoc, guint32 offset, guint32 pdv_len, gchar **pdv_description) + dcm_state_assoc_t *assoc, guint32 offset, guint32 pdv_len, gchar **pdv_description) { /* Handle one PDV inside a data PDU. Perform the necessary reassembly Create PDV object when needed @@ -6656,98 +6656,98 @@ dissect_dcm_pdv_fragmented(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (global_dcm_reassemble) { - conv = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, - pinfo->ptype, pinfo->srcport, pinfo->destport, 0); - - /* Try to create somewhat unique ID. - Include the conversation index, to separate TCP session - */ - reassembly_id = (((conv->index) & 0x00FFFFFF) << 8) + pdv->pctx_id; - - head = fragment_add_seq_next(&dcm_pdv_reassembly_table, - tvb, offset, pinfo, reassembly_id, NULL, - pdv_body_len, - !(pdv->is_last_fragment)); - - if (head && (head->next == NULL)) { - /* Was not really fragmented, therefore use 'conventional' decoding - fragment_add_seq_next() won't add any items to the list, when last fragment only - */ - - offset = dissect_dcm_pdv_body(tvb, pinfo, tree, pdv, offset, pdv_body_len, pdv_description); - } - else { - next_tvb = process_reassembled_data(tvb, offset, pinfo, - "Reassembled PDV", head, - &dcm_pdv_fragment_items, NULL, tree); - - if (next_tvb == NULL) { - /* Just show this as a fragment */ - - *pdv_description = (gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); - - if (head && head->reassembled_in != pinfo->fd->num) { - - if (pdv->desc) { - /* We know the presentation context already */ - g_snprintf(*pdv_description, MAX_BUF_LEN, "%s (reassembled in #%u)", pdv->desc, head->reassembled_in); - } - else { - /* Decoding of the presentation context did not occur yet or did not succeed */ - g_snprintf(*pdv_description, MAX_BUF_LEN, "PDV Fragment (reassembled in #%u)", head->reassembled_in); - } - } - else { - /* We have done done any tag decoding yet */ - g_snprintf(*pdv_description, MAX_BUF_LEN, "PDV Fragment"); - } - - offset += pdv_body_len; - } - else { - guint next_tvb_length = tvb_length(next_tvb); - /* Decode reassembled data */ - - if (tree || have_tap_listener(dicom_eo_tap)) { - /* The performance optimization now starts at tag level. - - During, tree can be NULL, but we need a few tags to be decoded, - i.e Class & Instance UID, so the export dialog has all information and - that the dicom header is complete - */ - offset += dissect_dcm_pdv_body(next_tvb, pinfo, tree, pdv, 0, next_tvb_length, pdv_description); - } - - if (have_tap_listener(dicom_eo_tap)) { - /* Copy pure DICOM data to buffer, no PDV flags */ - - pdv->data = g_malloc(next_tvb_length); /* will be freed in dcm_export_create_object() */ + conv = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, + pinfo->ptype, pinfo->srcport, pinfo->destport, 0); + + /* Try to create somewhat unique ID. + Include the conversation index, to separate TCP session + */ + reassembly_id = (((conv->index) & 0x00FFFFFF) << 8) + pdv->pctx_id; + + head = fragment_add_seq_next(&dcm_pdv_reassembly_table, + tvb, offset, pinfo, reassembly_id, NULL, + pdv_body_len, + !(pdv->is_last_fragment)); + + if (head && (head->next == NULL)) { + /* Was not really fragmented, therefore use 'conventional' decoding + fragment_add_seq_next() won't add any items to the list, when last fragment only + */ + + offset = dissect_dcm_pdv_body(tvb, pinfo, tree, pdv, offset, pdv_body_len, pdv_description); + } + else { + next_tvb = process_reassembled_data(tvb, offset, pinfo, + "Reassembled PDV", head, + &dcm_pdv_fragment_items, NULL, tree); + + if (next_tvb == NULL) { + /* Just show this as a fragment */ + + *pdv_description = (gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); + + if (head && head->reassembled_in != pinfo->fd->num) { + + if (pdv->desc) { + /* We know the presentation context already */ + g_snprintf(*pdv_description, MAX_BUF_LEN, "%s (reassembled in #%u)", pdv->desc, head->reassembled_in); + } + else { + /* Decoding of the presentation context did not occur yet or did not succeed */ + g_snprintf(*pdv_description, MAX_BUF_LEN, "PDV Fragment (reassembled in #%u)", head->reassembled_in); + } + } + else { + /* We have done done any tag decoding yet */ + g_snprintf(*pdv_description, MAX_BUF_LEN, "PDV Fragment"); + } + + offset += pdv_body_len; + } + else { + guint next_tvb_length = tvb_length(next_tvb); + /* Decode reassembled data */ + + if (tree || have_tap_listener(dicom_eo_tap)) { + /* The performance optimization now starts at tag level. + + During, tree can be NULL, but we need a few tags to be decoded, + i.e Class & Instance UID, so the export dialog has all information and + that the dicom header is complete + */ + offset += dissect_dcm_pdv_body(next_tvb, pinfo, tree, pdv, 0, next_tvb_length, pdv_description); + } + + if (have_tap_listener(dicom_eo_tap)) { + /* Copy pure DICOM data to buffer, no PDV flags */ + + pdv->data = g_malloc(next_tvb_length); /* will be freed in dcm_export_create_object() */ tvb_memcpy(next_tvb, pdv->data, 0, next_tvb_length); pdv->data_len = next_tvb_length; - /* Copy to export buffer */ - dcm_export_create_object(pinfo, assoc, pdv); - } - } - } + /* Copy to export buffer */ + dcm_export_create_object(pinfo, assoc, pdv); + } + } + } } else if (tree) { - /* Do not reassemble PDVs, i.e. decode PDV one by one. Only execute when in detail mode */ - offset = dissect_dcm_pdv_body(tvb, pinfo, tree, pdv, offset, pdv_body_len, pdv_description); + /* Do not reassemble PDVs, i.e. decode PDV one by one. Only execute when in detail mode */ + offset = dissect_dcm_pdv_body(tvb, pinfo, tree, pdv, offset, pdv_body_len, pdv_description); - /* During DICOM Export, perform a few extra steps */ - if (have_tap_listener(dicom_eo_tap)) { - /* Copy pure DICOM data to buffer, no PDV flags */ + /* During DICOM Export, perform a few extra steps */ + if (have_tap_listener(dicom_eo_tap)) { + /* Copy pure DICOM data to buffer, no PDV flags */ - pdv->data = g_malloc(pdv_body_len); /* will be freed in dcm_export_create_object() */ + pdv->data = g_malloc(pdv_body_len); /* will be freed in dcm_export_create_object() */ tvb_memcpy(tvb, pdv->data, startpos, pdv_body_len); pdv->data_len = pdv_body_len; - if ((pdv_body_len > 0) && (pdv->is_last_fragment)) { - /* At the last segment, merge all related previous PDVs and copy to export buffer */ - dcm_export_create_object(pinfo, assoc, pdv); - } - } + if ((pdv_body_len > 0) && (pdv->is_last_fragment)) { + /* At the last segment, merge all related previous PDVs and copy to export buffer */ + dcm_export_create_object(pinfo, assoc, pdv); + } + } } return offset; @@ -6755,25 +6755,25 @@ dissect_dcm_pdv_fragmented(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } static guint32 dissect_dcm_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - dcm_state_assoc_t *assoc, guint32 offset, guint32 pdu_len, gchar **pdu_data_description) + dcm_state_assoc_t *assoc, guint32 offset, guint32 pdu_len, gchar **pdu_data_description) { - /* 04 P-DATA-TF - 1 1 reserved - 2 4 length - - (1+) presentation data value (PDV) items - 6 4 length - 10 1 Presentation Context ID (odd ints 1 - 255) - - PDV - 11 1 header - 0x01 if set, contains Message Command info, else Message Data - 0x02 if set, contains last fragment + /* 04 P-DATA-TF + 1 1 reserved + 2 4 length + - (1+) presentation data value (PDV) items + 6 4 length + 10 1 Presentation Context ID (odd ints 1 - 255) + - PDV + 11 1 header + 0x01 if set, contains Message Command info, else Message Data + 0x02 if set, contains last fragment */ - proto_tree *pdv_ptree; /* Tree for item details */ + proto_tree *pdv_ptree; /* Tree for item details */ proto_item *pdv_pitem, *pdvlen_item; - gchar *buf_desc = NULL; /* PDU description */ + gchar *buf_desc = NULL; /* PDU description */ gchar *pdv_description = NULL; gboolean first_pdv = TRUE; @@ -6783,45 +6783,45 @@ dissect_dcm_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, endpos = offset + pdu_len; - buf_desc=(gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); /* Valid for this capture, since we return this buffer */ + buf_desc=(gchar *)wmem_alloc0(wmem_file_scope(), MAX_BUF_LEN); /* Valid for this capture, since we return this buffer */ /* Loop through multiple PDVs */ while (offset < endpos) { - pdv_len = tvb_get_ntohl(tvb, offset); - - pdv_ptree = proto_tree_add_subtree(tree, tvb, offset, pdv_len+4, ett_dcm_data_pdv, &pdv_pitem, "PDV"); - - pdvlen_item = proto_tree_add_item(pdv_ptree, hf_dcm_pdv_len, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - - if (pdv_len + 4 > pdu_len) { - expert_add_info_format(pinfo, pdvlen_item, &ei_dcm_pdv_len, "Invalid PDV length (too large)"); - return endpos; - } - else if (pdv_len <= 2) { - expert_add_info_format(pinfo, pdvlen_item, &ei_dcm_pdv_len, "Invalid PDV length (too small)"); - return endpos; - } - else if (((pdv_len >> 1) << 1) != pdv_len) { - expert_add_info_format(pinfo, pdvlen_item, &ei_dcm_pdv_len, "Invalid PDV length (not even)"); - return endpos; - } - - offset = dissect_dcm_pdv_fragmented(tvb, pinfo, pdv_ptree, assoc, offset, pdv_len, &pdv_description); - - /* The following doesn't seem to work anymore */ - if (pdv_description) { - if (first_pdv) { - g_snprintf(buf_desc, MAX_BUF_LEN, "%s", pdv_description); - } - else { - g_snprintf(buf_desc, MAX_BUF_LEN, "%s, %s", buf_desc, pdv_description); - } - } - - proto_item_append_text(pdv_pitem, ", %s", pdv_description); - first_pdv=FALSE; + pdv_len = tvb_get_ntohl(tvb, offset); + + pdv_ptree = proto_tree_add_subtree(tree, tvb, offset, pdv_len+4, ett_dcm_data_pdv, &pdv_pitem, "PDV"); + + pdvlen_item = proto_tree_add_item(pdv_ptree, hf_dcm_pdv_len, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + if (pdv_len + 4 > pdu_len) { + expert_add_info_format(pinfo, pdvlen_item, &ei_dcm_pdv_len, "Invalid PDV length (too large)"); + return endpos; + } + else if (pdv_len <= 2) { + expert_add_info_format(pinfo, pdvlen_item, &ei_dcm_pdv_len, "Invalid PDV length (too small)"); + return endpos; + } + else if (((pdv_len >> 1) << 1) != pdv_len) { + expert_add_info_format(pinfo, pdvlen_item, &ei_dcm_pdv_len, "Invalid PDV length (not even)"); + return endpos; + } + + offset = dissect_dcm_pdv_fragmented(tvb, pinfo, pdv_ptree, assoc, offset, pdv_len, &pdv_description); + + /* The following doesn't seem to work anymore */ + if (pdv_description) { + if (first_pdv) { + g_snprintf(buf_desc, MAX_BUF_LEN, "%s", pdv_description); + } + else { + g_snprintf(buf_desc, MAX_BUF_LEN, "%s, %s", buf_desc, pdv_description); + } + } + + proto_item_append_text(pdv_pitem, ", %s", pdv_description); + first_pdv=FALSE; } @@ -6844,88 +6844,88 @@ dissect_dcm_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean i int offset = 0; /* - Modified original code, which was optimized for a heuristic detection, and therefore - caused some load and memory consumption, for every non DICOM packet not processed - by someone else. + Modified original code, which was optimized for a heuristic detection, and therefore + caused some load and memory consumption, for every non DICOM packet not processed + by someone else. - Since tcp packets are now assembled well by wireshark (in conjunction with the dissectors) - we will only see properly aligned PDUs, at the beginning of the buffer, else it's not DICOM - traffic. + Since tcp packets are now assembled well by wireshark (in conjunction with the dissectors) + we will only see properly aligned PDUs, at the beginning of the buffer, else it's not DICOM + traffic. - Therefore do the byte checking as early as possible - The heuristic hook requires an association request + Therefore do the byte checking as early as possible + The heuristic hook requires an association request - DICOM PDU are nice, but need to be managed + DICOM PDU are nice, but need to be managed - We can have any combination: - - One or more DICOM PDU per TCP packet - - PDU split over different TCP packets - - And both together, i.e. some complete PDUs and then a fraction of a new PDU in a TCP packet + We can have any combination: + - One or more DICOM PDU per TCP packet + - PDU split over different TCP packets + - And both together, i.e. some complete PDUs and then a fraction of a new PDU in a TCP packet - This function will handle multiple PDUs per TCP packet and will ask for more data, - if the last PDU does not fit + This function will handle multiple PDUs per TCP packet and will ask for more data, + if the last PDU does not fit - It does not reassemble fragmented PDVs by purpose, since the Tag Value parsing needs to be done - per Tag, and PDU recombination here would - a) need to eliminate PDU/PDV/Ctx header (12 bytes) - b) not show the true DICOM logic in transfer + It does not reassemble fragmented PDVs by purpose, since the Tag Value parsing needs to be done + per Tag, and PDU recombination here would + a) need to eliminate PDU/PDV/Ctx header (12 bytes) + b) not show the true DICOM logic in transfer - The length check is tricky. If not a PDV continuation, 10 Bytes are required. For PDV continuation - anything seems to be possible, depending on the buffer alignment of the sending process. + The length check is tricky. If not a PDV continuation, 10 Bytes are required. For PDV continuation + anything seems to be possible, depending on the buffer alignment of the sending process. */ tlen = tvb_reported_length(tvb); pdu_type = tvb_get_guint8(tvb, 0); - if (pdu_type == 0 || pdu_type > 7) /* Wrong PDU type. 'Or' is slightly more efficient than 'and' */ - return 0; /* No bytes taken from the stack */ + if (pdu_type == 0 || pdu_type > 7) /* Wrong PDU type. 'Or' is slightly more efficient than 'and' */ + return 0; /* No bytes taken from the stack */ if (is_port_static) { - /* Port is defined explicitly, or association request was previously found successfully. - Be more tolerant on minimum packet size. Also accept < 6 - */ + /* Port is defined explicitly, or association request was previously found successfully. + Be more tolerant on minimum packet size. Also accept < 6 + */ - if (tlen < 6) { - /* we need 6 bytes at least to get PDU length */ - pinfo->desegment_offset = offset; + if (tlen < 6) { + /* we need 6 bytes at least to get PDU length */ + pinfo->desegment_offset = offset; pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; return TRUE; - } + } } else { - /* We operate in heuristic mode, be picky out of performance reasons: + /* We operate in heuristic mode, be picky out of performance reasons: - - Minimum 10 Bytes - - Look for the association request - - Reasonable PDU size + - Minimum 10 Bytes + - Look for the association request + - Reasonable PDU size - Tried find_conversation() and dcm_state_get() with no benefit + Tried find_conversation() and dcm_state_get() with no benefit - But since we are called in static mode, once we decoded the association request and - called conversation_set_dissector(), we really only need to filter for an association request + But since we are called in static mode, once we decoded the association request and + called conversation_set_dissector(), we really only need to filter for an association request - */ + */ if (tlen < 10) { - /* For all association handling ones, 10 bytes would be needed. Be happy with 6 */ - return 0; - } - - pdu_len = tvb_get_ntohl(tvb, 2); - vers = tvb_get_ntohs(tvb, 6); - - /* Exit, if not a association request at version 1*/ - if (!(pdu_type == 1 && vers == 1)) { - return 0; - } - - /* Exit if TCP payload is bigger than PDU length (plus header) - OK. for PRESENTATION_DATA, questionable for ASSOCIATION requests - */ - if (pdu_len+6 < tlen) { - return 0; - } + /* For all association handling ones, 10 bytes would be needed. Be happy with 6 */ + return 0; + } + + pdu_len = tvb_get_ntohl(tvb, 2); + vers = tvb_get_ntohs(tvb, 6); + + /* Exit, if not a association request at version 1*/ + if (!(pdu_type == 1 && vers == 1)) { + return 0; + } + + /* Exit if TCP payload is bigger than PDU length (plus header) + OK. for PRESENTATION_DATA, questionable for ASSOCIATION requests + */ + if (pdu_len+6 < tlen) { + return 0; + } } @@ -6933,7 +6933,7 @@ dissect_dcm_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean i pdu_len = tvb_get_ntohl(tvb, 2); if (pdu_len < 4) /* The smallest PDUs are ASSOC Rejects & Release Msgs */ - return 0; + return 0; /* Mark it. This is a DICOM packet */ @@ -6941,41 +6941,41 @@ dissect_dcm_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean i /* Process all PDUs in the buffer */ while (pdu_start < tlen) { - guint32 old_pdu_start; - - if ((pdu_len+6) > (tlen-offset)) { - - /* PDU is larger than the remaining packet (buffer), therefore request whole PDU - The next time this function is called, tlen will be equal to pdu_len - */ - - pinfo->desegment_offset = offset; - pinfo->desegment_len = (pdu_len+6) - (tlen-offset); - - /* Why return a Boolean for a deliberate int function? No clue, but - no better working example found. - */ - return TRUE; - } - - /* Process a whole PDU */ - offset=dissect_dcm_pdu(tvb, pinfo, tree, pdu_start); - - /* Next PDU */ - old_pdu_start = pdu_start; - pdu_start = pdu_start + pdu_len + 6; - if (pdu_start <= old_pdu_start) { - expert_add_info_format(pinfo, NULL, &ei_dcm_invalid_pdu_length, "Invalid PDU length (%u)", pdu_len); - THROW(ReportedBoundsError); - } - - if (pdu_start < tlen - 6) { - /* we got at least 6 bytes of the next PDU still in the buffer */ - pdu_len = tvb_get_ntohl(tvb, pdu_start+2); - } - else { - pdu_len = 0; - } + guint32 old_pdu_start; + + if ((pdu_len+6) > (tlen-offset)) { + + /* PDU is larger than the remaining packet (buffer), therefore request whole PDU + The next time this function is called, tlen will be equal to pdu_len + */ + + pinfo->desegment_offset = offset; + pinfo->desegment_len = (pdu_len+6) - (tlen-offset); + + /* Why return a Boolean for a deliberate int function? No clue, but + no better working example found. + */ + return TRUE; + } + + /* Process a whole PDU */ + offset=dissect_dcm_pdu(tvb, pinfo, tree, pdu_start); + + /* Next PDU */ + old_pdu_start = pdu_start; + pdu_start = pdu_start + pdu_len + 6; + if (pdu_start <= old_pdu_start) { + expert_add_info_format(pinfo, NULL, &ei_dcm_invalid_pdu_length, "Invalid PDU length (%u)", pdu_len); + THROW(ReportedBoundsError); + } + + if (pdu_start < tlen - 6) { + /* we got at least 6 bytes of the next PDU still in the buffer */ + pdu_len = tvb_get_ntohl(tvb, pdu_start+2); + } + else { + pdu_len = 0; + } } return offset; } @@ -6999,10 +6999,10 @@ dissect_dcm_heuristic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void static guint32 dissect_dcm_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { - proto_tree *dcm_ptree=NULL; /* Root DICOM tree and its item */ + proto_tree *dcm_ptree=NULL; /* Root DICOM tree and its item */ proto_item *dcm_pitem=NULL; - dcm_state_t *dcm_data=NULL; + dcm_state_t *dcm_data=NULL; dcm_state_assoc_t *assoc=NULL; guint8 pdu_type=0; @@ -7013,8 +7013,8 @@ dissect_dcm_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 off /* Get or create conversation. Used to store context IDs and xfer Syntax */ dcm_data = dcm_state_get(pinfo, TRUE); - if (dcm_data == NULL) { /* Internal error. Failed to create main dicom data structure */ - return offset; + if (dcm_data == NULL) { /* Internal error. Failed to create main dicom data structure */ + return offset; } dcm_pitem = proto_tree_add_item(tree, proto_dcm, tvb, offset, -1, ENC_NA); @@ -7022,7 +7022,7 @@ dissect_dcm_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 off pdu_type = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(dcm_ptree, hf_dcm_pdu, tvb, offset, 2, - pdu_type, "PDU Type 0x%x (%s)", pdu_type, dcm_pdu2str(pdu_type)); + pdu_type, "PDU Type 0x%x (%s)", pdu_type, dcm_pdu2str(pdu_type)); offset += 2; pdu_len = tvb_get_ntohl(tvb, offset); @@ -7032,27 +7032,27 @@ dissect_dcm_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 off /* Find previously detected association, else create a new one object*/ assoc = dcm_state_assoc_get(dcm_data, pinfo->fd->num, TRUE); - if (assoc == NULL) { /* Internal error. Failed to create association structure */ - return offset; + if (assoc == NULL) { /* Internal error. Failed to create association structure */ + return offset; } if (pdu_type == 4) { - col_set_str(pinfo->cinfo, COL_INFO, "P-DATA"); + col_set_str(pinfo->cinfo, COL_INFO, "P-DATA"); - offset = dissect_dcm_pdu_data(tvb, pinfo, dcm_ptree, assoc, offset, pdu_len, &pdu_data_description); + offset = dissect_dcm_pdu_data(tvb, pinfo, dcm_ptree, assoc, offset, pdu_len, &pdu_data_description); - if (pdu_data_description) { - proto_item_append_text(dcm_pitem, ", %s", pdu_data_description); - col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pdu_data_description); - } + if (pdu_data_description) { + proto_item_append_text(dcm_pitem, ", %s", pdu_data_description); + col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", pdu_data_description); + } } else { - /* Decode Association request, response, reject, abort details */ + /* Decode Association request, response, reject, abort details */ offset = dissect_dcm_assoc_header(tvb, pinfo, dcm_ptree, offset, assoc, pdu_type, pdu_len); } - return offset; /* return the number of processed bytes */ + return offset; /* return the number of processed bytes */ } static void dcm_apply_settings(void) { @@ -7063,10 +7063,10 @@ static void dcm_apply_settings(void) { heur_dissector_delete("tcp", dissect_dcm_heuristic, proto_dcm); - /* Register 'static' tcp port range specified in properties - Statically defined ports take precedence over a heuristic one, - I.e., if an foreign protocol claims a port, where dicom is running on - We would never be called, by just having the heuristic registration + /* Register 'static' tcp port range specified in properties + Statically defined ports take precedence over a heuristic one, + I.e., if an foreign protocol claims a port, where dicom is running on + We would never be called, by just having the heuristic registration */ dissector_add_uint_range("tcp.port", global_dcm_tcp_range, dcm_handle); @@ -7074,10 +7074,10 @@ static void dcm_apply_settings(void) { /* remember settings for next time */ global_dcm_tcp_range_backup = range_copy(global_dcm_tcp_range); - /* Add heuristic search, if user selected it */ + /* Add heuristic search, if user selected it */ if (global_dcm_heuristic) - heur_dissector_add("tcp", dissect_dcm_heuristic, proto_dcm); + heur_dissector_add("tcp", dissect_dcm_heuristic, proto_dcm); } @@ -7088,170 +7088,170 @@ proto_register_dcm(void) { static hf_register_info hf[] = { { &hf_dcm_pdu, { "PDU Type", "dicom.pdu.type", - FT_UINT8, BASE_HEX, VALS(dcm_pdu_ids), 0, NULL, HFILL } }, + FT_UINT8, BASE_HEX, VALS(dcm_pdu_ids), 0, NULL, HFILL } }, { &hf_dcm_pdu_len, { "PDU Length", "dicom.pdu.len", - FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, #if 0 { &hf_dcm_pdu_type, { "PDU Detail", "dicom.pdu.detail", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, #endif { &hf_dcm_assoc_version, { "Protocol Version", "dicom.assoc.version", - FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_assoc_called, { "Called AE Title", "dicom.assoc.ae.called", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_assoc_calling, { "Calling AE Title", "dicom.assoc.ae.calling", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_assoc_reject_result, { "Result", "dicom.assoc.reject.result", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_assoc_reject_source, { "Source", "dicom.assoc.reject.source", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_assoc_reject_reason, { "Reason", "dicom.assoc.reject.reason", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_assoc_abort_source, { "Source", "dicom.assoc.abort.source", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_assoc_abort_reason, { "Reason", "dicom.assoc.abort.reason", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_assoc_item_type, { "Item Type", "dicom.assoc.item.type", - FT_UINT8, BASE_HEX, VALS(dcm_assoc_item_type), 0, NULL, HFILL } }, + FT_UINT8, BASE_HEX, VALS(dcm_assoc_item_type), 0, NULL, HFILL } }, { &hf_dcm_assoc_item_len, { "Item Length", "dicom.assoc.item.len", - FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_actx, { "Application Context", "dicom.actx", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_pctx_id, { "Presentation Context ID", "dicom.pctx.id", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_dcm_pctx_result, { "Presentation Context Result", "dicom.pctx.id", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_dcm_pctx_abss_syntax, { "Abstract Syntax", "dicom.pctx.abss.syntax", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_pctx_xfer_syntax, { "Transfer Syntax", "dicom.pctx.xfer.syntax", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_info, { "User Info", "dicom.userinfo", - FT_NONE, BASE_NONE, NULL, 0, "This field contains the ACSE User Information Item of the A-ASSOCIATErequest.", HFILL } }, + FT_NONE, BASE_NONE, NULL, 0, "This field contains the ACSE User Information Item of the A-ASSOCIATErequest.", HFILL } }, { &hf_dcm_info_uid, { "Implementation Class UID", "dicom.userinfo.uid", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_info_version, { "Implementation Version", "dicom.userinfo.version", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_info_extneg, { "Extended Negotiation", "dicom.userinfo.extneg", - FT_NONE, BASE_NONE, NULL, 0, "This field contains the optional SOP Class Extended Negotiation Sub-Item of the ACSE User Information Item of the A-ASSOCIATE-RQ/RSP.", HFILL } }, + FT_NONE, BASE_NONE, NULL, 0, "This field contains the optional SOP Class Extended Negotiation Sub-Item of the ACSE User Information Item of the A-ASSOCIATE-RQ/RSP.", HFILL } }, { &hf_dcm_info_extneg_sopclassuid_len, { "SOP Class UID Length", "dicom.userinfo.extneg.sopclassuid.len", - FT_UINT16, BASE_DEC, NULL, 0, "This field contains the length of the SOP Class UID in the Extended Negotiation Sub-Item.", HFILL } }, + FT_UINT16, BASE_DEC, NULL, 0, "This field contains the length of the SOP Class UID in the Extended Negotiation Sub-Item.", HFILL } }, { &hf_dcm_info_extneg_sopclassuid, { "SOP Class UID", "dicom.userinfo.extneg.sopclassuid", - FT_STRING, BASE_NONE, NULL, 0, "This field contains the SOP Class UID in the Extended Negotiation Sub-Item.", HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, "This field contains the SOP Class UID in the Extended Negotiation Sub-Item.", HFILL } }, { &hf_dcm_info_extneg_relational_query, { "Relational-queries", "dicom.userinfo.extneg.relational", - FT_UINT8, BASE_HEX, NULL, 0, "This field indicates, if relational queries are supported.", HFILL } }, + FT_UINT8, BASE_HEX, NULL, 0, "This field indicates, if relational queries are supported.", HFILL } }, { &hf_dcm_info_extneg_date_time_matching, { "Combined Date-Time matching", "dicom.userinfo.extneg.datetimematching", - FT_UINT8, BASE_HEX, NULL, 0, "This field indicates, if combined date-time matching is supported.", HFILL } }, + FT_UINT8, BASE_HEX, NULL, 0, "This field indicates, if combined date-time matching is supported.", HFILL } }, { &hf_dcm_info_extneg_fuzzy_semantic_matching, { "Fuzzy semantic matching", "dicom.userinfo.extneg.fuzzymatching", - FT_UINT8, BASE_HEX, NULL, 0, "This field indicates, if fuzzy semantic matching of person names is supported.", HFILL } }, + FT_UINT8, BASE_HEX, NULL, 0, "This field indicates, if fuzzy semantic matching of person names is supported.", HFILL } }, { &hf_dcm_info_extneg_timezone_query_adjustment, { "Timezone query adjustment", "dicom.userinfo.extneg.timezone", - FT_UINT8, BASE_HEX, NULL, 0, "This field indicates, if timezone query adjustment is supported.", HFILL } }, + FT_UINT8, BASE_HEX, NULL, 0, "This field indicates, if timezone query adjustment is supported.", HFILL } }, { &hf_dcm_info_rolesel, { "SCP/SCU Role Selection", "dicom.userinfo.rolesel", - FT_NONE, BASE_NONE, NULL, 0, "This field contains the optional SCP/SCU Role Selection Sub-Item of the ACSE User Information Item of the A-ASSOCIATE-RQ/RSP.", HFILL } }, + FT_NONE, BASE_NONE, NULL, 0, "This field contains the optional SCP/SCU Role Selection Sub-Item of the ACSE User Information Item of the A-ASSOCIATE-RQ/RSP.", HFILL } }, { &hf_dcm_info_rolesel_sopclassuid_len, { "SOP Class UID Length", "dicom.userinfo.rolesel.sopclassuid.len", - FT_UINT16, BASE_DEC, NULL, 0, "This field contains the length of the SOP Class UID in the SCP/SCU Role Selection Sub-Item.", HFILL } }, + FT_UINT16, BASE_DEC, NULL, 0, "This field contains the length of the SOP Class UID in the SCP/SCU Role Selection Sub-Item.", HFILL } }, { &hf_dcm_info_rolesel_sopclassuid, { "SOP Class UID", "dicom.userinfo.rolesel.sopclassuid", - FT_STRING, BASE_NONE, NULL, 0, "This field contains the SOP Class UID in the SCP/SCU Role Selection Sub-Item.", HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, "This field contains the SOP Class UID in the SCP/SCU Role Selection Sub-Item.", HFILL } }, { &hf_dcm_info_rolesel_scurole, { "SCU-role", "dicom.userinfo.rolesel.scurole", - FT_UINT8, BASE_HEX, NULL, 0, "This field contains the SCU-role as defined for the Association-requester.", HFILL } }, + FT_UINT8, BASE_HEX, NULL, 0, "This field contains the SCU-role as defined for the Association-requester.", HFILL } }, { &hf_dcm_info_rolesel_scprole, { "SCP-role", "dicom.userinfo.rolesel.scprole", - FT_UINT8, BASE_HEX, NULL, 0, "This field contains the SCP-role as defined for the Association-requester.", HFILL } }, + FT_UINT8, BASE_HEX, NULL, 0, "This field contains the SCP-role as defined for the Association-requester.", HFILL } }, { &hf_dcm_info_async_neg, { "Asynchronous Operations (and sub-operations) Window Negotiation", "dicom.userinfo.asyncneg", - FT_NONE, BASE_NONE, NULL, 0, "This field contains the optional Asynchronous Operations (and sub-operations) Window Negotiation Sub-Item of the ACSE User Information Item of the A-ASSOCIATE-RQ/RSP.", HFILL } }, + FT_NONE, BASE_NONE, NULL, 0, "This field contains the optional Asynchronous Operations (and sub-operations) Window Negotiation Sub-Item of the ACSE User Information Item of the A-ASSOCIATE-RQ/RSP.", HFILL } }, { &hf_dcm_info_async_neg_max_num_ops_inv, { "Maximum-number-operations-invoked", "dicom.userinfo.asyncneg.maxnumopsinv", - FT_UINT16, BASE_DEC, NULL, 0, "This field contains the maximum-number-operations-invoked in the Asynchronous Operations (and sub-operations) Window Negotiation Sub-Item.", HFILL } }, + FT_UINT16, BASE_DEC, NULL, 0, "This field contains the maximum-number-operations-invoked in the Asynchronous Operations (and sub-operations) Window Negotiation Sub-Item.", HFILL } }, { &hf_dcm_info_async_neg_max_num_ops_per, { "Maximum-number-operations-performed", "dicom.userinfo.asyncneg.maxnumopsper", - FT_UINT16, BASE_DEC, NULL, 0, "This field contains the maximum-number-operations-performed in the Asynchronous Operations (and sub-operations) Window Negotiation Sub-Item.", HFILL } }, + FT_UINT16, BASE_DEC, NULL, 0, "This field contains the maximum-number-operations-performed in the Asynchronous Operations (and sub-operations) Window Negotiation Sub-Item.", HFILL } }, { &hf_dcm_pdu_maxlen, { "Max PDU Length", "dicom.max_pdu_len", - FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_pdv_len, { "PDV Length", "dicom.pdv.len", - FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_pdv_ctx, { "PDV Context", "dicom.pdv.ctx", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_pdv_flags, { "PDV Flags", "dicom.pdv.flags", - FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, + FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_dcm_data_tag, { "Tag", "dicom.data.tag", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_tag, { "Tag", "dicom.tag", - FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, + FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_dcm_tag_vr, { "VR", "dicom.tag.vr", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_tag_vl, { "Length", "dicom.tag.vl", - FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_tag_value_str, { "Value", "dicom.tag.value.str", - FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_dcm_tag_value_16s, { "Value", "dicom.tag.value.16s", - FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_tag_value_16u, { "Value", "dicom.tag.value.16u", - FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_tag_value_32s, { "Value", "dicom.tag.value.32s", - FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_tag_value_32u, { "Value", "dicom.tag.value.32u", - FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, + FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_dcm_tag_value_byte, { "Value", "dicom.tag.value.byte", - FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, /* Fragment entries */ { &hf_dcm_pdv_fragments, - { "Message fragments", "dicom.pdv.fragments", - FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + { "Message fragments", "dicom.pdv.fragments", + FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_dcm_pdv_fragment, - { "Message fragment", "dicom.pdv.fragment", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + { "Message fragment", "dicom.pdv.fragment", + FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_dcm_pdv_fragment_overlap, - { "Message fragment overlap", "dicom.pdv.fragment.overlap", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + { "Message fragment overlap", "dicom.pdv.fragment.overlap", + FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_dcm_pdv_fragment_overlap_conflicts, - { "Message fragment overlapping with conflicting data", - "dicom.pdv.fragment.overlap.conflicts", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + { "Message fragment overlapping with conflicting data", + "dicom.pdv.fragment.overlap.conflicts", + FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_dcm_pdv_fragment_multiple_tails, - { "Message has multiple tail fragments", - "dicom.pdv.fragment.multiple_tails", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + { "Message has multiple tail fragments", + "dicom.pdv.fragment.multiple_tails", + FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_dcm_pdv_fragment_too_long_fragment, - { "Message fragment too long", "dicom.pdv.fragment.too_long_fragment", - FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + { "Message fragment too long", "dicom.pdv.fragment.too_long_fragment", + FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_dcm_pdv_fragment_error, - { "Message defragmentation error", "dicom.pdv.fragment.error", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + { "Message defragmentation error", "dicom.pdv.fragment.error", + FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_dcm_pdv_fragment_count, - { "Message fragment count", "dicom.pdv.fragment_count", - FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, + { "Message fragment count", "dicom.pdv.fragment_count", + FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_dcm_pdv_reassembled_in, - { "Reassembled in", "dicom.pdv.reassembled.in", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + { "Reassembled in", "dicom.pdv.reassembled.in", + FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_dcm_pdv_reassembled_length, - { "Reassembled PDV length", "dicom.pdv.reassembled.length", - FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } } + { "Reassembled PDV length", "dicom.pdv.reassembled.length", + FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { - &ett_dcm, - &ett_assoc, - &ett_assoc_header, - &ett_assoc_actx, - &ett_assoc_pctx, - &ett_assoc_pctx_abss, - &ett_assoc_pctx_xfer, - &ett_assoc_info, - &ett_assoc_info_uid, - &ett_assoc_info_version, - &ett_assoc_info_extneg, - &ett_assoc_info_rolesel, - &ett_assoc_info_async_neg, - &ett_dcm_data, - &ett_dcm_data_pdv, - &ett_dcm_data_tag, - &ett_dcm_data_seq, - &ett_dcm_data_item, - &ett_dcm_pdv, /* used for fragments */ - &ett_dcm_pdv_fragment, - &ett_dcm_pdv_fragments + &ett_dcm, + &ett_assoc, + &ett_assoc_header, + &ett_assoc_actx, + &ett_assoc_pctx, + &ett_assoc_pctx_abss, + &ett_assoc_pctx_xfer, + &ett_assoc_info, + &ett_assoc_info_uid, + &ett_assoc_info_version, + &ett_assoc_info_extneg, + &ett_assoc_info_rolesel, + &ett_assoc_info_async_neg, + &ett_dcm_data, + &ett_dcm_data_pdv, + &ett_dcm_data_tag, + &ett_dcm_data_seq, + &ett_dcm_data_item, + &ett_dcm_pdv, /* used for fragments */ + &ett_dcm_pdv_fragment, + &ett_dcm_pdv_fragments }; static ei_register_info ei[] = { @@ -7291,53 +7291,53 @@ proto_register_dcm(void) range_convert_str(&global_dcm_tcp_range, DICOM_DEFAULT_RANGE, 65535); global_dcm_tcp_range_backup = range_empty(); prefs_register_range_preference(dcm_module, "tcp.port", - "DICOM Ports", "DICOM Ports range", &global_dcm_tcp_range, 65535); + "DICOM Ports", "DICOM Ports range", &global_dcm_tcp_range, 65535); prefs_register_bool_preference(dcm_module, "heuristic", - "Search on any TCP Port (heuristic mode)", - "When enabled, the DICOM dissector will parse all TCP packets " - "not handled by any other dissector and look for an association request. " - "Disabled by default, to preserve resources for the non DICOM community.", - &global_dcm_heuristic); + "Search on any TCP Port (heuristic mode)", + "When enabled, the DICOM dissector will parse all TCP packets " + "not handled by any other dissector and look for an association request. " + "Disabled by default, to preserve resources for the non DICOM community.", + &global_dcm_heuristic); prefs_register_bool_preference(dcm_module, "export_header", - "Create Meta Header on Export", - "Create DICOM File Meta Header according to PS 3.10 on export for PDUs. " - "If the captured PDV does not contain a SOP Class UID and SOP Instance UID " - "(e.g. for command PDVs), wireshark specific ones will be created.", - &global_dcm_export_header); + "Create Meta Header on Export", + "Create DICOM File Meta Header according to PS 3.10 on export for PDUs. " + "If the captured PDV does not contain a SOP Class UID and SOP Instance UID " + "(e.g. for command PDVs), wireshark specific ones will be created.", + &global_dcm_export_header); prefs_register_uint_preference(dcm_module, "export_minsize", - "Min. item size in bytes to export", - "Do not show items below this size in the export list. " - "Set it to 0, to see DICOM commands and responses in the list. " - "Set it higher, to just export DICOM IODs (i.e. CT Images, RT Structures).", 10, - &global_dcm_export_minsize); + "Min. item size in bytes to export", + "Do not show items below this size in the export list. " + "Set it to 0, to see DICOM commands and responses in the list. " + "Set it higher, to just export DICOM IODs (i.e. CT Images, RT Structures).", 10, + &global_dcm_export_minsize); prefs_register_bool_preference(dcm_module, "seq_tree", - "Create subtrees for Sequences and Items", - "Create a node for sequences and items, and show children in a hierarchy. " - "Deselect this option, if you prefer a flat display or e.g. " - "when using TShark to create a text output.", - &global_dcm_seq_subtree); + "Create subtrees for Sequences and Items", + "Create a node for sequences and items, and show children in a hierarchy. " + "Deselect this option, if you prefer a flat display or e.g. " + "when using TShark to create a text output.", + &global_dcm_seq_subtree); prefs_register_bool_preference(dcm_module, "tag_tree", - "Create subtrees for DICOM Tags", - "Create a node for a tag and show tag details as single elements. " - "This can be useful to debug a tag and to allow display filters on these attributes. " - "When using TShark to create a text output, it's better to have it disabled. ", - &global_dcm_tag_subtree); + "Create subtrees for DICOM Tags", + "Create a node for a tag and show tag details as single elements. " + "This can be useful to debug a tag and to allow display filters on these attributes. " + "When using TShark to create a text output, it's better to have it disabled. ", + &global_dcm_tag_subtree); prefs_register_bool_preference(dcm_module, "cmd_details", - "Show command details in header", - "Show message ID and number of completed, remaining, warned or failed operations in header and info column.", - &global_dcm_cmd_details); + "Show command details in header", + "Show message ID and number of completed, remaining, warned or failed operations in header and info column.", + &global_dcm_cmd_details); prefs_register_bool_preference(dcm_module, "pdv_reassemble", - "Merge fragmented PDVs", - "Decode all DICOM tags in the last PDV. This will ensure the proper reassembly. " - "When not set, the decoding may fail and the exports may become corrupt.", - &global_dcm_reassemble); + "Merge fragmented PDVs", + "Decode all DICOM tags in the last PDV. This will ensure the proper reassembly. " + "When not set, the decoding may fail and the exports may become corrupt.", + &global_dcm_reassemble); dicom_eo_tap = register_tap("dicom_eo"); /* DICOM Export Object tap */ @@ -7350,7 +7350,7 @@ proto_reg_handoff_dcm(void) dcm_handle = new_create_dissector_handle(dissect_dcm_static, proto_dcm); - dcm_apply_settings(); /* Register static and heuristic ports */ + dcm_apply_settings(); /* Register static and heuristic ports */ } @@ -7385,17 +7385,17 @@ PDU's 1 result (1 reject perm, 2 reject transient) 1 source (1 service user, 2 service provider, 3 service provider) 1 reason - 1 == source - 1 no reason given - 2 application context name not supported - 3 calling aetitle not recognized - 7 called aetitle not recognized - 2 == source - 1 no reason given - 2 protocol version not supported - 3 == source - 1 temporary congestion - 2 local limit exceeded + 1 == source + 1 no reason given + 2 application context name not supported + 3 calling aetitle not recognized + 7 called aetitle not recognized + 2 == source + 1 no reason given + 2 protocol version not supported + 3 == source + 1 temporary congestion + 2 local limit exceeded 04 P-DATA 1 1 reserved @@ -7403,10 +7403,10 @@ PDU's - (1+) presentation data value (PDV) items 6 4 length 10 1 Presentation Context ID (odd ints 1 - 255) - - PDV + - PDV 11 1 header - 0x01 if set, contains Message Command info, else Message Data - 0x02 if set, contains last fragment + 0x01 if set, contains Message Command info, else Message Data + 0x02 if set, contains last fragment 05 A-RELEASE-RQ 1 reserved @@ -7556,3 +7556,16 @@ From 3.7 Annex D Association Negotiation 7-n Server-response This field shall contain the Kerberos Server ticket, encoded in accordance with RFC-1510, if the User-Identity-Type value in the A-ASSOCIATE-RQ was 3. This field shall contain the SAML response if the User-Identity-Type value in the A-ASSOCIATE-RQ was 4. This field shall be zero length if the value of the User-Identity-Type in the A-ASSOCIATE-RQ was 1 or 2. */ + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c index c185ce4d0d..9c38478a7b 100644 --- a/epan/dissectors/packet-dcom.c +++ b/epan/dissectors/packet-dcom.c @@ -2463,7 +2463,7 @@ proto_register_dcom (void) proto_register_field_array(proto_dcom, hf_dcom_sa_array, array_length(hf_dcom_sa_array)); proto_register_subtree_array (ett_dcom, array_length (ett_dcom)); - expert_dcom = expert_register_protocol(proto_dcom); + expert_dcom = expert_register_protocol(proto_dcom); expert_register_field_array(expert_dcom, ei, array_length(ei)); /* preferences */ @@ -2492,3 +2492,16 @@ proto_reg_handoff_dcom (void) /* Currently, we have nothing to register for DCOM */ } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c index 43113aabb5..384acf9945 100644 --- a/epan/dissectors/packet-extreme.c +++ b/epan/dissectors/packet-extreme.c @@ -277,9 +277,9 @@ static gint ett_edp_null = -1; #define PROTO_LONG_NAME "Extreme Discovery Protocol" static const value_string extreme_pid_vals[] = { - { 0x00bb, "EDP" }, + { 0x00bb, "EDP" }, - { 0, NULL } + { 0, NULL } }; static const value_string esrp_proto_vals[] = { @@ -965,7 +965,7 @@ dissect_edp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint16 tlv_length; guint16 data_length; guint16 seqno; - vec_t cksum_vec[1]; + vec_t cksum_vec[1]; col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME); col_set_str(pinfo->cinfo, COL_INFO, PROTO_SHORT_NAME ":"); @@ -1450,7 +1450,7 @@ proto_register_edp(void) { &hf_edp_null, { "End", "edp.null", FT_PROTOCOL, BASE_NONE, NULL, 0x0, "Last element", HFILL }}, - }; + }; static gint *ett[] = { &ett_edp, &ett_edp_checksum, @@ -1495,11 +1495,24 @@ void proto_register_extreme_oui(void) { static hf_register_info hf[] = { - { &hf_llc_extreme_pid, - { "PID", "llc.extreme_pid", FT_UINT16, BASE_HEX, - VALS(extreme_pid_vals), 0x0, NULL, HFILL } - } + { &hf_llc_extreme_pid, + { "PID", "llc.extreme_pid", FT_UINT16, BASE_HEX, + VALS(extreme_pid_vals), 0x0, NULL, HFILL } + } }; llc_add_oui(OUI_EXTREME, "llc.extreme_pid", "LLC Extreme OUI PID", hf); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-ged125.c b/epan/dissectors/packet-ged125.c index be54ad59ed..db56d556ab 100644 --- a/epan/dissectors/packet-ged125.c +++ b/epan/dissectors/packet-ged125.c @@ -1781,3 +1781,16 @@ proto_reg_handoff_ged125(void) old_ged125_tcp_port = global_tcp_port_ged125; } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-gmr1_rr.c b/epan/dissectors/packet-gmr1_rr.c index f1e4a3fa2c..d678b0cb6c 100644 --- a/epan/dissectors/packet-gmr1_rr.c +++ b/epan/dissectors/packet-gmr1_rr.c @@ -1761,7 +1761,7 @@ static const gmr1_msg_func_t gmr1_msg_rr_func[NUM_GMR1_MSG_RR] = { void gmr1_get_msg_rr_params(guint8 oct, int dcch, const gchar **msg_str, - int *ett_tree, int *hf_idx, gmr1_msg_func_t *msg_func_p) + int *ett_tree, int *hf_idx, gmr1_msg_func_t *msg_func_p) { const gchar *m = NULL; gint idx; @@ -2468,3 +2468,16 @@ proto_reg_handoff_gmr1_rr(void) { data_handle = find_dissector("data"); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-gsm_abis_oml.c b/epan/dissectors/packet-gsm_abis_oml.c index 3cfbc28698..8adaece769 100644 --- a/epan/dissectors/packet-gsm_abis_oml.c +++ b/epan/dissectors/packet-gsm_abis_oml.c @@ -2401,3 +2401,16 @@ proto_reg_handoff_abis_oml(void) sub_om2000 = find_dissector("gsm_abis_om2000"); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-h248_annex_c.c b/epan/dissectors/packet-h248_annex_c.c index 9f0522971c..7c3d130697 100644 --- a/epan/dissectors/packet-h248_annex_c.c +++ b/epan/dissectors/packet-h248_annex_c.c @@ -316,7 +316,7 @@ static const value_string h248_annexc_package_properties_vals[] = { { 0xC005, "CLC" }, { 0xC006, "CLCack" }, -{ 0, NULL } + { 0,NULL } }; @@ -325,7 +325,7 @@ static const value_string h248_annexc_media_vals[] = { { 0, "Audio" }, { 1, "Video" }, { 2, "Data" }, - { 0, NULL } + { 0,NULL } }; static const value_string h248_pkg_annexc_Mediatx_vals[] = { @@ -338,399 +338,399 @@ static const value_string h248_pkg_annexc_Mediatx_vals[] = { }; static const value_string h248_annexc_transmission_mode[] = { - {0,"Send"}, - {1,"Receive"}, - {2,"Send&Receive"}, - {0,NULL} + {0, "Send"}, + {1, "Receive"}, + {2, "Send&Receive"}, + {0,NULL} }; static const value_string h248_pkg_annexc_sc[] _U_ = { - {0,"CBR"}, - {1,"nrt-VBR1"}, - {2,"nrt-VBR2"}, - {3,"nrt-VBR3"}, - {4,"rt-VBR1"}, - {5,"rt-VBR2"}, - {6,"rt-VBR3"}, - {7,"UBR1"}, - {8,"UBR2"}, - {9,"ABR"}, - {0,NULL} + {0, "CBR"}, + {1, "nrt-VBR1"}, + {2, "nrt-VBR2"}, + {3, "nrt-VBR3"}, + {4, "rt-VBR1"}, + {5, "rt-VBR2"}, + {6, "rt-VBR3"}, + {7, "UBR1"}, + {8, "UBR2"}, + {9, "ABR"}, + {0,NULL} }; static const value_string h248_pkg_annexc_atc_values[] = { - {0,"DBR"}, - {1,"SBR1"}, - {2,"SBR2"}, - {3,"SBR3"}, - {4,"ABT/IT"}, - {5,"ABT/DT"}, - {6,"ABR"}, - {0,NULL} + {0, "DBR"}, + {1, "SBR1"}, + + {2, "SBR2"}, + {3, "SBR3"}, + {4, "ABT/IT"}, + {5, "ABT/DT"}, + {6, "ABR"}, + {0,NULL} }; static const value_string h248_pkg_annexc_stc_values[] = { - {0,"Not Susceptible to clipping"}, - {1,"Susceptible to clipping"}, - {0,NULL} + {0, "Not Susceptible to clipping"}, + {1, "Susceptible to clipping"}, + {0,NULL} }; static const value_string h248_pkg_annexc_uppc_values[] = { - {0,"point-to-point"}, - {1,"point-to-multipoint"}, - {0,NULL} + {0, "point-to-point"}, + {1, "point-to-multipoint"}, + {0,NULL} }; static const value_string h248_pkg_annexc_syncasync_values[] = { {0, "Synchronous Data"}, {1, "Asynchronous Data"}, - {0,NULL} + {0,NULL} }; static const value_string h248_pkg_annexc_negotiation_values[] = { {0, "In-Band negotiation possible"}, {1, "In-Band negotiation not possible"}, - {0,NULL} + {0,NULL} }; static const value_string h248_pkg_annexc_userrate_values[] = { - {0x0,"E-Bit specified I.460 or higher negotiated in-band"}, - {0x1,"0.6 kbps (X.1)"}, - {0x2,"1.2 kbps"}, - {0x3,"2.4 kbps (X.1)"}, - {0x4,"3.6 kbps"}, - {0x5,"4.8 kbps (X.1)"}, - {0x6,"7.2 kbps"}, - {0x7,"8 kbps (I.460)"}, - {0x8,"9.6 kbps (X.1)"}, - {0x9,"14.4 kbps"}, - {0xa,"16 kbps (I.460)"}, - {0xb,"19.2 kbps"}, - {0xc,"32 kbps (I.460)"}, - {0xd,"38.4 kbps (V.110)"}, - {0xe,"48 kbps (X.1)"}, - {0xf,"56 kbps"}, - - {0x12,"57.6 kbps (V.14 extended)"}, - {0x13,"28.8 kbps (V.110)"}, - {0x14,"24 kbps (V.110)"}, - {0x15,"0.1345 kbps (X.1)"}, - {0x16,"0.100 kbps (X.1)"}, - {0x17,"0.075/1.2 kbps (X.1)"}, - {0x18,"1.2/0.075 kbps (X.1)"}, - {0x19,"0.050 kbps (X.1)"}, - {0x1a,"0.075 kbps (X.1)"}, - {0x1b,"0.110 kbps (X.1)"}, - {0x1c,"0.150 kbps (X.1)"}, - {0x1d,"0.200 kbps (X.1)"}, - {0x1e,"0.300 kbps (X.1)"}, - {0x1f,"12 kbps (X.1)"}, - - {0,NULL} + {0x0, "E-Bit specified I.460 or higher negotiated in-band"}, + {0x1, "0.6 kbps (X.1)"}, + {0x2, "1.2 kbps"}, + {0x3, "2.4 kbps (X.1)"}, + {0x4, "3.6 kbps"}, + {0x5, "4.8 kbps (X.1)"}, + {0x6, "7.2 kbps"}, + {0x7, "8 kbps (I.460)"}, + {0x8, "9.6 kbps (X.1)"}, + {0x9, "14.4 kbps"}, + {0xa, "16 kbps (I.460)"}, + {0xb, "19.2 kbps"}, + {0xc, "32 kbps (I.460)"}, + {0xd, "38.4 kbps (V.110)"}, + {0xe, "48 kbps (X.1)"}, + {0xf, "56 kbps"}, + + {0x12, "57.6 kbps (V.14 extended)"}, + {0x13, "28.8 kbps (V.110)"}, + {0x14, "24 kbps (V.110)"}, + {0x15, "0.1345 kbps (X.1)"}, + {0x16, "0.100 kbps (X.1)"}, + {0x17, "0.075/1.2 kbps (X.1)"}, + {0x18, "1.2/0.075 kbps (X.1)"}, + {0x19, "0.050 kbps (X.1)"}, + {0x1a, "0.075 kbps (X.1)"}, + {0x1b, "0.110 kbps (X.1)"}, + {0x1c, "0.150 kbps (X.1)"}, + {0x1d, "0.200 kbps (X.1)"}, + {0x1e, "0.300 kbps (X.1)"}, + {0x1f, "12 kbps (X.1)"}, + {0,NULL} }; static const value_string h248_pkg_annexc_intrate_values[] = { - {0x0,"Not Used"}, - {0x1,"8 kbps"}, - {0x2,"16 kbps"}, - {0x3,"32 kbps"}, - {0,NULL} + {0x0, "Not Used"}, + {0x1, "8 kbps"}, + {0x2, "16 kbps"}, + {0x3, "32 kbps"}, + {0,NULL} }; static const value_string h248_pkg_annexc_nictx_values[] = { - {0,"Not required to transmit with NIC"}, - {1,"Required to transmit with NIC"}, - {0,NULL} + {0, "Not required to transmit with NIC"}, + {1, "Required to transmit with NIC"}, + {0,NULL} }; static const value_string h248_pkg_annexc_nicrx_values[] = { - {0,"Cannot accept data with NIC"}, - {1,"Can accept data with NIC"}, - {0,NULL} + {0, "Cannot accept data with NIC"}, + {1, "Can accept data with NIC"}, + {0,NULL} }; static const value_string h248_pkg_annexc_flowconttx_values[] = { - {0,"Not Required"}, - {1,"Required"}, - {0,NULL} + {0, "Not Required"}, + {1, "Required"}, + {0,NULL} }; static const value_string h248_pkg_annexc_flowcontrx_values[] = { - {0,"Cannot accept data with flow control mechanism"}, - {1,"Can accept data with flow control mechanism"}, - {0,NULL} + {0, "Cannot accept data with flow control mechanism"}, + {1, "Can accept data with flow control mechanism"}, + {0,NULL} }; static const value_string h248_pkg_annexc_rateadapthdr_values[] = { - {0,"not included"}, - {1,"included"}, - {0,NULL} + {0, "not included"}, + {1, "included"}, + {0,NULL} }; static const value_string h248_pkg_annexc_multiframe_values[] = { - {0,"not supported"}, - {1,"supported"}, - {0,NULL} + {0, "not supported"}, + {1, "supported"}, + {0,NULL} }; static const value_string h248_pkg_annexc_opmode_values[] = { - {0,"bit transparent"}, - {1,"protocol sensitive"}, - {0,NULL} + {0, "bit transparent"}, + {1, "protocol sensitive"}, + {0,NULL} }; static const value_string h248_pkg_annexc_llidnegot_values[] = { - {0,"Default, LLI=256 only"}, - {1,"Full protocol negotiation"}, - {0,NULL} + {0, "Default, LLI=256 only"}, + {1, "Full protocol negotiation"}, + {0,NULL} }; static const value_string h248_pkg_annexc_assign_values[] = { - {0,"Originator is default assignee"}, - {1,"Originator is assignor only"}, - {0,NULL} + {0, "Originator is default assignee"}, + {1, "Originator is assignor only"}, + {0,NULL} }; static const value_string h248_pkg_annexc_inbandneg_values[] = { - {0,"negotiation on temporary signalling connection"}, - {1,"negotiation in-band"}, - {0,NULL} + {0, "negotiation on temporary signalling connection"}, + {1, "negotiation in-band"}, + {0,NULL} }; static const value_string h248_pkg_annexc_stopbits_values[] = { - {0,"none"}, - {1,"1 bit"}, - {2,"1.5 bits"}, - {3,"2 bits"}, - {0,NULL} + {0, "none"}, + {1, "1 bit"}, + {2, "1.5 bits"}, + {3, "2 bits"}, + {0,NULL} }; static const value_string h248_pkg_annexc_databits_values[] = { - {0,"Not Used"}, - {1,"5 bits"}, - {2,"7 bits"}, - {3,"8 bits"}, - {0,NULL} + {0, "Not Used"}, + {1, "5 bits"}, + {2, "7 bits"}, + {3, "8 bits"}, + {0,NULL} }; static const value_string h248_pkg_annexc_parity_values[] = { - {0,"Odd"}, - {2,"Even"}, - {3,"None"}, - {4,"Forced to 0"}, - {5,"Forced to 1"}, - {0,NULL} + {0, "Odd"}, + {2, "Even"}, + {3, "None"}, + {4, "Forced to 0"}, + {5, "Forced to 1"}, + {0,NULL} }; static const value_string h248_pkg_annexc_duplexmode_values[] = { - {0,"Half Duplex"}, - {1,"Full Duplex"}, - {0,NULL} + {0, "Half Duplex"}, + {1, "Full Duplex"}, + {0,NULL} }; static const value_string h248_pkg_annexc_modem_values[] = { - {0x00,"National Use"}, - {0x01,"National Use"}, - {0x02,"National Use"}, - {0x03,"National Use"}, - {0x04,"National Use"}, - {0x05,"National Use"}, - - {0x11,"V.21"}, - {0x12,"V.22"}, - {0x13,"V.22bis"}, - {0x14,"V.23"}, - {0x15,"V.26"}, - {0x16,"V.26bis"}, - {0x17,"V.26ter"}, - {0x18,"V.27"}, - {0x19,"V.27bis"}, - {0x1A,"V.27ter"}, - {0x1B,"V.29"}, - {0x1D,"V.32"}, - {0x1E,"V.34"}, - - {0x20,"National Use"}, - {0x21,"National Use"}, - {0x22,"National Use"}, - {0x23,"National Use"}, - {0x24,"National Use"}, - {0x25,"National Use"}, - {0x26,"National Use"}, - {0x27,"National Use"}, - {0x28,"National Use"}, - {0x29,"National Use"}, - {0x2a,"National Use"}, - {0x2b,"National Use"}, - {0x2c,"National Use"}, - {0x2d,"National Use"}, - {0x2e,"National Use"}, - {0x2f,"National Use"}, - - {0x30,"User Specified"}, - {0x31,"User Specified"}, - {0x32,"User Specified"}, - {0x33,"User Specified"}, - {0x34,"User Specified"}, - {0x35,"User Specified"}, - {0x36,"User Specified"}, - {0x37,"User Specified"}, - {0x38,"User Specified"}, - {0x39,"User Specified"}, - {0x3a,"User Specified"}, - {0x3b,"User Specified"}, - {0x3c,"User Specified"}, - {0x3d,"User Specified"}, - {0x3e,"User Specified"}, - {0x3f,"User Specified"}, - - {0,NULL} + {0x00, "National Use"}, + {0x01, "National Use"}, + {0x02, "National Use"}, + {0x03, "National Use"}, + {0x04, "National Use"}, + {0x05, "National Use"}, + + {0x11, "V.21"}, + {0x12, "V.22"}, + {0x13, "V.22bis"}, + {0x14, "V.23"}, + {0x15, "V.26"}, + {0x16, "V.26bis"}, + {0x17, "V.26ter"}, + {0x18, "V.27"}, + {0x19, "V.27bis"}, + {0x1A, "V.27ter"}, + {0x1B, "V.29"}, + {0x1D, "V.32"}, + {0x1E, "V.34"}, + + {0x20, "National Use"}, + {0x21, "National Use"}, + {0x22, "National Use"}, + {0x23, "National Use"}, + {0x24, "National Use"}, + {0x25, "National Use"}, + {0x26, "National Use"}, + {0x27, "National Use"}, + {0x28, "National Use"}, + {0x29, "National Use"}, + {0x2a, "National Use"}, + {0x2b, "National Use"}, + {0x2c, "National Use"}, + {0x2d, "National Use"}, + {0x2e, "National Use"}, + {0x2f, "National Use"}, + + {0x30, "User Specified"}, + {0x31, "User Specified"}, + {0x32, "User Specified"}, + {0x33, "User Specified"}, + {0x34, "User Specified"}, + {0x35, "User Specified"}, + {0x36, "User Specified"}, + {0x37, "User Specified"}, + {0x38, "User Specified"}, + {0x39, "User Specified"}, + {0x3a, "User Specified"}, + {0x3b, "User Specified"}, + {0x3c, "User Specified"}, + {0x3d, "User Specified"}, + {0x3e, "User Specified"}, + {0x3f, "User Specified"}, + + {0,NULL} }; static const value_string h248_pkg_annexc_layer2prot_values[] = { - {0x2,"Q.921/I.441"}, - {0x6,"X.25, link layer"}, - {0xC,"LLC (ISO/IEC 8802-2)"}, - {0,NULL} + {0x2, "Q.921/I.441"}, + {0x6, "X.25, link layer"}, + {0xC, "LLC (ISO/IEC 8802-2)"}, + {0,NULL} }; static const value_string h248_pkg_annexc_layer3prot_values[] = { - {0x2,"Q.921/I.441"}, - {0x6,"X.25, packet layer"}, - {0xC,"IP, ISO/IEC TR 9577"}, - {0,NULL} + {0x2, "Q.921/I.441"}, + {0x6, "X.25, packet layer"}, + {0xC, "IP, ISO/IEC TR 9577"}, + {0,NULL} }; static const value_string h248_pkg_annexc_addlayer3prot_values[] = { - {0xCC,"IP (RFC 791)"}, - {0xCF,"PPP (RFC 1661)"}, - {0,NULL} + {0xCC, "IP (RFC 791)"}, + {0xCF, "PPP (RFC 1661)"}, + {0,NULL} }; static const value_string h248_pkg_annexc_nci_satellite_values[] _U_ = { - {0x0,"no satellite circuit"}, - {0x1,"one satellite circuit"}, - {0x2,"two satellite circuits"}, - {0x3,"spare"}, - {0,NULL} + {0x0, "no satellite circuit"}, + {0x1, "one satellite circuit"}, + {0x2, "two satellite circuits"}, + {0x3, "spare"}, + {0,NULL} }; static const value_string h248_pkg_annexc_nci_continuity_values[] _U_ = { - {0x0,"continuity check not required"}, - {0x1,"continuity check required on this circuit"}, - {0x2,"continuity check performed on a previous circuit"}, - {0x3,"spare"}, - {0,NULL} + {0x0, "continuity check not required"}, + {0x1, "continuity check required on this circuit"}, + {0x2, "continuity check performed on a previous circuit"}, + {0x3, "spare"}, + {0,NULL} }; static const value_string h248_pkg_annexc_nci_echoctl_values[] _U_ = { - {0x0,"outgoing echo control device not included"}, - {0x1,"outgoing echo control device included"}, - {0,NULL} + {0x0, "outgoing echo control device not included"}, + {0x1, "outgoing echo control device included"}, + {0,NULL} }; static const value_string h248_pkg_annexc_QosClass_values[] = { - {0x0,"Default"}, - {0x1,"Stringent"}, - {0x2,"Tolerant"}, - {0x3,"Bi-Level"}, - {0x4,"Unbounded"}, - {0x5,"Stringent Bi-level"}, - {0,NULL} + {0x0, "Default"}, + {0x1, "Stringent"}, + {0x2, "Tolerant"}, + {0x3, "Bi-Level"}, + {0x4, "Unbounded"}, + {0x5, "Stringent Bi-level"}, + {0,NULL} }; static const value_string h248_pkg_annexc_AALtype_values[] = { - {0x0,"AAL for Voice"}, - {0x1,"AAL1"}, - {0x2,"AAL2"}, - {0x3,"AAL3/4"}, - {0x5,"AAL5"}, - {0x10,"User Defined"}, - {0,NULL} + {0x0, "AAL for Voice"}, + {0x1, "AAL1"}, + {0x2, "AAL2"}, + {0x3, "AAL3/4"}, + {0x5, "AAL5"}, + {0x10, "User Defined"}, + {0,NULL} }; static const value_string h248_pkg_annexc_porttype_values[] = { - {0x0,"TCP"}, - {0x1,"UDP"}, - {0x2,"SCTP"}, - {0,NULL} + {0x0, "TCP"}, + {0x1, "UDP"}, + {0x2, "SCTP"}, + {0,NULL} }; static const value_string h248_pkg_annexc_aal1st_values[] = { - {0x0,"null"}, - {0x1,"voiceband signal transport on 64kbps"}, - {0x2,"circuit transport"}, - {0x4,"high quality audio signal transport"}, - {0x5,"video signal transport"}, - {0,NULL} + {0x0, "null"}, + {0x1, "voiceband signal transport on 64kbps"}, + {0x2, "circuit transport"}, + {0x4, "high quality audio signal transport"}, + {0x5, "video signal transport"}, + {0,NULL} }; static const value_string h248_pkg_annexc_cbrr_values[] = { - {0x01,"64 kbps"}, - {0x04,"1544 kbps"}, - {0x05,"6312 kbps"}, - {0x06,"32064 kbps"}, - {0x07,"44736 kbps"}, - {0x08,"44736 kbps"}, - {0x10,"2048 kbps"}, - {0x11,"8448 kbps"}, - {0x12,"34368 kbps"}, - {0x13,"139264 kbps"}, - {0x40,"n * 64 kbps"}, - {0x41,"n * 8 kbps"}, - {0,NULL} + {0x01, "64 kbps"}, + {0x04, "1544 kbps"}, + {0x05, "6312 kbps"}, + {0x06, "32064 kbps"}, + {0x07, "44736 kbps"}, + {0x08, "44736 kbps"}, + {0x10, "2048 kbps"}, + {0x11, "8448 kbps"}, + {0x12, "34368 kbps"}, + {0x13, "139264 kbps"}, + {0x40, "n * 64 kbps"}, + {0x41, "n * 8 kbps"}, + {0,NULL} }; static const value_string h248_pkg_annexc_scri_values[] = { - {0x0,"null"}, - {0x1,"SRTS"}, - {0x2,"ACM"}, - {0,NULL} + {0x0, "null"}, + {0x1, "SRTS"}, + {0x2, "ACM"}, + {0,NULL} }; static const value_string h248_pkg_annexc_ecm_values[] = { - {0x0,"null"}, - {0x1,"FEC - Loss"}, - {0x2,"FEC - Delay"}, - {0,NULL} + {0x0, "null"}, + {0x1, "FEC - Loss"}, + {0x2, "FEC - Delay"}, + {0,NULL} }; static const value_string h248_pkg_annexc_tmrsr_values[] = { /* TO DO */ - {0,NULL} + {0,NULL} }; static const value_string h248_pkg_annexc_contcheck_values[] = { /* TO DO */ - {0,NULL} + {0,NULL} }; static const value_string h248_pkg_annexc_itc_values[] = { /* TO DO */ - {0,NULL} + {0,NULL} }; static const value_string h248_pkg_annexc_transmode_values[] = { /* TO DO */ - {0,NULL} + {0,NULL} }; static const value_string h248_pkg_annexc_transrate_values[] = { /* TO DO */ - {0,NULL} + {0,NULL} }; @@ -811,8 +811,8 @@ static void dissect_h248_annexc_SDP(proto_tree* tree, tvbuff_t* tvb, packet_info asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); dissect_ber_restricted_string( FALSE, BER_UNI_TAG_IA5String, - &asn1_ctx, tree, tvb, 0, hfid, - NULL); + &asn1_ctx, tree, tvb, 0, hfid, + NULL); } gboolean h248_c_implicit = TRUE; @@ -951,11 +951,11 @@ static h248_pkg_param_t h248_annexc_package_properties[] = { { 0xB00e, &hf_h248_pkg_annexc_sdp_r, dissect_h248_annexc_SDP, &h248_c_implicit }, { 0xB00f, &hf_h248_pkg_annexc_sdp_m, dissect_h248_annexc_SDP, &h248_c_implicit }, - { 0xC001, &hf_h248_pkg_annexc_olc, h248_param_ber_octetstring, NULL }, + { 0xC001, &hf_h248_pkg_annexc_olc, h248_param_ber_octetstring, NULL }, { 0xC002, &hf_h248_pkg_annexc_olcack, h248_param_ber_octetstring, NULL }, { 0xC003, &hf_h248_pkg_annexc_olccnf, h248_param_ber_octetstring, NULL }, { 0xC004, &hf_h248_pkg_annexc_olcrej, h248_param_ber_octetstring, NULL }, - { 0xC005, &hf_h248_pkg_annexc_clc, h248_param_ber_octetstring, NULL }, + { 0xC005, &hf_h248_pkg_annexc_clc, h248_param_ber_octetstring, NULL }, { 0xC006, &hf_h248_pkg_annexc_clcack, h248_param_ber_octetstring, NULL }, { 0, NULL, NULL, NULL } @@ -979,524 +979,526 @@ static h248_package_t h248_annexc_package = { void proto_register_h248_annex_c(void) { static hf_register_info hf[] = { { &hf_h248_pkg_annexc_media, - { "Media", "h248.annexc.media", FT_UINT32, BASE_HEX, VALS(h248_annexc_media_vals), 0, "Media Type", HFILL }}, + { "Media", "h248.annexc.media", + FT_UINT32, BASE_HEX, VALS(h248_annexc_media_vals), 0, + "Media Type", HFILL }}, { &hf_h248_pkg_annexc_ACodec, - { "ACodec", "h248.annexc.ACodec", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "ACodec", "h248.annexc.ACodec", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_Mediatx, - { "Mediatx", "h248.annexc.Mediatx", - FT_UINT32, BASE_DEC, VALS(h248_pkg_annexc_Mediatx_vals), 0, - NULL, HFILL }}, + { "Mediatx", "h248.annexc.Mediatx", + FT_UINT32, BASE_DEC, VALS(h248_pkg_annexc_Mediatx_vals), 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_BIR, - { "BIR", "h248.annexc.BIR", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "BIR", "h248.annexc.BIR", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_NSAP, - { "NSAP", "h248.annexc.NSAP", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "NSAP", "h248.annexc.NSAP", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_transmission_mode, - { "Transmission Mode", "h248.annexc.transmission_mode", - FT_UINT32, BASE_DEC, VALS(h248_annexc_transmission_mode), 0, - NULL, HFILL }}, + { "Transmission Mode", "h248.annexc.transmission_mode", + FT_UINT32, BASE_DEC, VALS(h248_annexc_transmission_mode), 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_num_of_channels, - { "Number of Channels", "h248.annexc.num_of_channels", - FT_UINT32, BASE_DEC, NULL, 0, - NULL, HFILL }}, + { "Number of Channels", "h248.annexc.num_of_channels", + FT_UINT32, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_sampling_rate, - { "Sampling Rate", "h248.annexc.sampling_rate", - FT_UINT32, BASE_DEC, NULL, 0, - NULL, HFILL }}, + { "Sampling Rate", "h248.annexc.sampling_rate", + FT_UINT32, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_bit_rate, - { "Bit Rate", "h248.annexc.bit_rate", - FT_UINT32, BASE_DEC, NULL, 0, - NULL, HFILL }}, + { "Bit Rate", "h248.annexc.bit_rate", + FT_UINT32, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_samplepp, - { "Samplepp", "h248.annexc.samplepp", - FT_UINT32, BASE_DEC, NULL, 0, - NULL, HFILL }}, + { "Samplepp", "h248.annexc.samplepp", + FT_UINT32, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_silence_supp, - { "SilenceSupp", "h248.annexc.silence_supp", - FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Silence Suppression", HFILL }}, + { "SilenceSupp", "h248.annexc.silence_supp", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Silence Suppression", HFILL }}, { &hf_h248_pkg_annexc_encrypt_type, - { "Encrypttype", "h248.annexc.encrypt_type", - FT_BYTES, BASE_NONE, NULL, 0, - "Encryption Type", HFILL }}, + { "Encrypttype", "h248.annexc.encrypt_type", + FT_BYTES, BASE_NONE, NULL, 0, + "Encryption Type", HFILL }}, { &hf_h248_pkg_annexc_encrypt_key, - { "Encrypt Key", "h248.annexc.encrypt_key", - FT_UINT32, BASE_DEC, NULL, 0, - "Encryption Key", HFILL }}, + { "Encrypt Key", "h248.annexc.encrypt_key", + FT_UINT32, BASE_DEC, NULL, 0, + "Encryption Key", HFILL }}, { &hf_h248_pkg_annexc_gain, - { "Gain", "h248.annexc.gain", - FT_UINT32, BASE_DEC, NULL, 0, - "Gain (dB)", HFILL }}, + { "Gain", "h248.annexc.gain", + FT_UINT32, BASE_DEC, NULL, 0, + "Gain (dB)", HFILL }}, { &hf_h248_pkg_annexc_jitterbuf, - { "JitterBuff", "h248.annexc.jitterbuf", - FT_UINT32, BASE_DEC, NULL, 0, - "Jitter Buffer Size (ms)", HFILL }}, + { "JitterBuff", "h248.annexc.jitterbuf", + FT_UINT32, BASE_DEC, NULL, 0, + "Jitter Buffer Size (ms)", HFILL }}, { &hf_h248_pkg_annexc_propdelay, - { "Propagation Delay", "h248.annexc.encrypt_type", - FT_UINT32, BASE_DEC, NULL, 0, - "Propagation Delay (ms)", HFILL }}, + { "Propagation Delay", "h248.annexc.encrypt_type", + FT_UINT32, BASE_DEC, NULL, 0, + "Propagation Delay (ms)", HFILL }}, { &hf_h248_pkg_annexc_rtp_payload, - { "RTP Payload type", "h248.annexc.rtp_payload", - FT_UINT32, BASE_DEC, NULL, 0, - "Payload type in RTP Profile", HFILL }}, + { "RTP Payload type", "h248.annexc.rtp_payload", + FT_UINT32, BASE_DEC, NULL, 0, + "Payload type in RTP Profile", HFILL }}, { &hf_h248_pkg_annexc_h222, - { "H222LogicalChannelParameters", "h248.annexc.h222", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "H222LogicalChannelParameters", "h248.annexc.h222", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_h223, - { "H223LogicalChannelParameters", "h248.annexc.h223", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "H223LogicalChannelParameters", "h248.annexc.h223", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_v76, - { "V76LogicalChannelParameters", "h248.annexc.v76", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "V76LogicalChannelParameters", "h248.annexc.v76", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_h2250, - { "H2250LogicalChannelParameters", "h248.annexc.h2250", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "H2250LogicalChannelParameters", "h248.annexc.h2250", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_aesa, - { "AESA", "h248.annexc.aesa", - FT_BYTES, BASE_NONE, NULL, 0, - "ATM End System Address", HFILL }}, + { "AESA", "h248.annexc.aesa", + FT_BYTES, BASE_NONE, NULL, 0, + "ATM End System Address", HFILL }}, { &hf_h248_pkg_annexc_vp, - { "VPI", "h248.annexc.vpi", - FT_UINT16, BASE_DEC, NULL, 0, - "Virtual Path Identifier", HFILL }}, + { "VPI", "h248.annexc.vpi", + FT_UINT16, BASE_DEC, NULL, 0, + "Virtual Path Identifier", HFILL }}, { &hf_h248_pkg_annexc_vc, - { "VCI", "h248.annexc.vci", - FT_UINT16, BASE_DEC, NULL, 0, - "Virtual Circuit Identifier", HFILL }}, + { "VCI", "h248.annexc.vci", + FT_UINT16, BASE_DEC, NULL, 0, + "Virtual Circuit Identifier", HFILL }}, { &hf_h248_pkg_annexc_sc, - { "Service Class", "h248.annexc.sc", - FT_UINT32, BASE_DEC, NULL, 0, - NULL, HFILL }}, + { "Service Class", "h248.annexc.sc", + FT_UINT32, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_bcob, - { "BCOB", "h248.annexc.bcob", - FT_UINT8, BASE_DEC, NULL, 0x1F, - "Broadband Bearer Class", HFILL }}, + { "BCOB", "h248.annexc.bcob", + FT_UINT8, BASE_DEC, NULL, 0x1F, + "Broadband Bearer Class", HFILL }}, { &hf_h248_pkg_annexc_bbtc, - { "BBTC", "h248.annexc.bbtc", - FT_UINT8, BASE_DEC, NULL, 0x3F, - "Broadband Transfer Capability", HFILL }}, + { "BBTC", "h248.annexc.bbtc", + FT_UINT8, BASE_DEC, NULL, 0x3F, + "Broadband Transfer Capability", HFILL }}, { &hf_h248_pkg_annexc_atc, - { "ATC", "h248.annexc.atc", - FT_UINT32, BASE_DEC, VALS(h248_pkg_annexc_atc_values), 0x0, - "ATM Traffic Capability", HFILL }}, + { "ATC", "h248.annexc.atc", + FT_UINT32, BASE_DEC, VALS(h248_pkg_annexc_atc_values), 0x0, + "ATM Traffic Capability", HFILL }}, { &hf_h248_pkg_annexc_stc, - { "STC", "h248.annexc.stc", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_stc_values), 0x03, - "Susceptibility to Clipping", HFILL }}, + { "STC", "h248.annexc.stc", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_stc_values), 0x03, + "Susceptibility to Clipping", HFILL }}, { &hf_h248_pkg_annexc_uppc, - { "UPPC", "h248.annexc.uppc", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_uppc_values), 0x03, - "User Plane Connection Configuration", HFILL }}, + { "UPPC", "h248.annexc.uppc", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_uppc_values), 0x03, + "User Plane Connection Configuration", HFILL }}, { &hf_h248_pkg_annexc_pcr0, - { "PCR0", "h248.annexc.pcr0", - FT_UINT24, BASE_DEC, NULL, 0, - "Peak Cell Rate for CLP=0", HFILL }}, + { "PCR0", "h248.annexc.pcr0", + FT_UINT24, BASE_DEC, NULL, 0, + "Peak Cell Rate for CLP=0", HFILL }}, { &hf_h248_pkg_annexc_scr0, - { "SCR0", "h248.annexc.scr0", - FT_UINT24, BASE_DEC, NULL, 0, - "Sustained Cell Rate for CLP=0", HFILL }}, + { "SCR0", "h248.annexc.scr0", + FT_UINT24, BASE_DEC, NULL, 0, + "Sustained Cell Rate for CLP=0", HFILL }}, { &hf_h248_pkg_annexc_mbs0, - { "MBS0", "h248.annexc.mbs0", - FT_UINT24, BASE_DEC, NULL, 0, - "Maximum Burst Size for CLP=0", HFILL }}, + { "MBS0", "h248.annexc.mbs0", + FT_UINT24, BASE_DEC, NULL, 0, + "Maximum Burst Size for CLP=0", HFILL }}, { &hf_h248_pkg_annexc_pcr1, - { "PCR1", "h248.annexc.pcr1", - FT_UINT24, BASE_DEC, NULL, 0, - "Peak Cell Rate for CLP=1", HFILL }}, + { "PCR1", "h248.annexc.pcr1", + FT_UINT24, BASE_DEC, NULL, 0, + "Peak Cell Rate for CLP=1", HFILL }}, { &hf_h248_pkg_annexc_scr1, - { "SCR1", "h248.annexc.scr1", - FT_UINT24, BASE_DEC, NULL, 0, - "Sustained Cell Rate for CLP=1", HFILL }}, + { "SCR1", "h248.annexc.scr1", + FT_UINT24, BASE_DEC, NULL, 0, + "Sustained Cell Rate for CLP=1", HFILL }}, { &hf_h248_pkg_annexc_mbs1, - { "MBS1", "h248.annexc.mbs1", - FT_UINT24, BASE_DEC, NULL, 0, - "Maximum Burst Size for CLP=1", HFILL }}, + { "MBS1", "h248.annexc.mbs1", + FT_UINT24, BASE_DEC, NULL, 0, + "Maximum Burst Size for CLP=1", HFILL }}, { &hf_h248_pkg_annexc_bei, - { "BEI", "h248.annexc.bei", - FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Best Effort Indicator", HFILL }}, + { "BEI", "h248.annexc.bei", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Best Effort Indicator", HFILL }}, { &hf_h248_pkg_annexc_ti, - { "TI", "h248.annexc.ti", - FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Tagging Indicator", HFILL }}, + { "TI", "h248.annexc.ti", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Tagging Indicator", HFILL }}, { &hf_h248_pkg_annexc_fd, - { "FD", "h248.annexc.fd", - FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Frame Discard", HFILL }}, + { "FD", "h248.annexc.fd", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Frame Discard", HFILL }}, { &hf_h248_pkg_annexc_a2pcdv, - { "A2PCDV", "h248.annexc.a2pcdv", - FT_UINT24, BASE_DEC, NULL, 0, - "Acceptable 2 point CDV", HFILL }}, + { "A2PCDV", "h248.annexc.a2pcdv", + FT_UINT24, BASE_DEC, NULL, 0, + "Acceptable 2 point CDV", HFILL }}, { &hf_h248_pkg_annexc_c2pcdv, - { "C2PCDV", "h248.annexc.c2pcdv", - FT_UINT24, BASE_DEC, NULL, 0, - "Cumulative 2 point CDV", HFILL }}, + { "C2PCDV", "h248.annexc.c2pcdv", + FT_UINT24, BASE_DEC, NULL, 0, + "Cumulative 2 point CDV", HFILL }}, { &hf_h248_pkg_annexc_appcdv, - { "APPCDV", "h248.annexc.appcdv", - FT_UINT24, BASE_DEC, NULL, 0, - "Acceptable Point to Point CDV", HFILL }}, + { "APPCDV", "h248.annexc.appcdv", + FT_UINT24, BASE_DEC, NULL, 0, + "Acceptable Point to Point CDV", HFILL }}, { &hf_h248_pkg_annexc_cppcdv, - { "CPPCDV", "h248.annexc.cppcdv", - FT_UINT24, BASE_DEC, NULL, 0, - "Cumulative Point to Point CDV", HFILL }}, + { "CPPCDV", "h248.annexc.cppcdv", + FT_UINT24, BASE_DEC, NULL, 0, + "Cumulative Point to Point CDV", HFILL }}, { &hf_h248_pkg_annexc_aclr, - { "ACLR", "h248.annexc.aclr", - FT_UINT8, BASE_DEC, NULL, 0, - "Acceptable Cell Loss Ratio (Q.2965.2 ATMF UNI 4.0)", HFILL }}, + { "ACLR", "h248.annexc.aclr", + FT_UINT8, BASE_DEC, NULL, 0, + "Acceptable Cell Loss Ratio (Q.2965.2 ATMF UNI 4.0)", HFILL }}, { &hf_h248_pkg_annexc_meetd, - { "MEETD", "h248.annexc.meetd", - FT_UINT16, BASE_DEC, NULL, 0, - "Maximum End-to-End Transit Delay (Q.2965.2 ATMF UNI 4.0)", HFILL }}, + { "MEETD", "h248.annexc.meetd", + FT_UINT16, BASE_DEC, NULL, 0, + "Maximum End-to-End Transit Delay (Q.2965.2 ATMF UNI 4.0)", HFILL }}, { &hf_h248_pkg_annexc_ceetd, - { "CEETD", "h248.annexc.ceetd", - FT_UINT16, BASE_DEC, NULL, 0, - "Cumulative End-to-End Transit Delay (Q.2965.2 ATMF UNI 4.0)", HFILL }}, + { "CEETD", "h248.annexc.ceetd", + FT_UINT16, BASE_DEC, NULL, 0, + "Cumulative End-to-End Transit Delay (Q.2965.2 ATMF UNI 4.0)", HFILL }}, { &hf_h248_pkg_annexc_QosClass, - { "QosClass", "h248.annexc.qosclass", - FT_UINT16, BASE_DEC, VALS(h248_pkg_annexc_QosClass_values), 0, - "QoS Class (Q.2965.1)", HFILL }}, + { "QosClass", "h248.annexc.qosclass", + FT_UINT16, BASE_DEC, VALS(h248_pkg_annexc_QosClass_values), 0, + "QoS Class (Q.2965.1)", HFILL }}, { &hf_h248_pkg_annexc_AALtype, - { "AALtype", "h248.annexc.aaltype", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_AALtype_values), 0, - "AAL Type", HFILL }}, + { "AALtype", "h248.annexc.aaltype", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_AALtype_values), 0, + "AAL Type", HFILL }}, { &hf_h248_pkg_annexc_dlci, - { "DLCI", "h248.annexc.dlci", - FT_UINT32, BASE_DEC, NULL, 0, - "Data Link Connection ID (FR)", HFILL }}, + { "DLCI", "h248.annexc.dlci", + FT_UINT32, BASE_DEC, NULL, 0, + "Data Link Connection ID (FR)", HFILL }}, { &hf_h248_pkg_annexc_cid, - { "CID", "h248.annexc.cid", - FT_UINT32, BASE_DEC, NULL, 0, - "Channel-Id", HFILL }}, + { "CID", "h248.annexc.cid", + FT_UINT32, BASE_DEC, NULL, 0, + "Channel-Id", HFILL }}, { &hf_h248_pkg_annexc_sid, - { "SID", "h248.annexc.sid", - FT_UINT32, BASE_DEC, NULL, 0, - "Silence Insertion Descriptor", HFILL }}, + { "SID", "h248.annexc.sid", + FT_UINT32, BASE_DEC, NULL, 0, + "Silence Insertion Descriptor", HFILL }}, { &hf_h248_pkg_annexc_ppt, - { "PPT", "h248.annexc.ppt", - FT_UINT32, BASE_DEC, NULL, 0, - "Primary Payload Type", HFILL }}, + { "PPT", "h248.annexc.ppt", + FT_UINT32, BASE_DEC, NULL, 0, + "Primary Payload Type", HFILL }}, { &hf_h248_pkg_annexc_ipv4, - { "IPv4", "h248.annexc.ipv4", - FT_IPv4, BASE_NONE, NULL, 0, - "IPv4 Address", HFILL }}, + { "IPv4", "h248.annexc.ipv4", + FT_IPv4, BASE_NONE, NULL, 0, + "IPv4 Address", HFILL }}, { &hf_h248_pkg_annexc_ipv6, - { "IPv6", "h248.annexc.ipv6", - FT_IPv6, BASE_NONE, NULL, 0, - "IPv6 Address", HFILL }}, + { "IPv6", "h248.annexc.ipv6", + FT_IPv6, BASE_NONE, NULL, 0, + "IPv6 Address", HFILL }}, { &hf_h248_pkg_annexc_port, - { "Port", "h248.annexc.port", - FT_UINT16, BASE_DEC, NULL, 0, - NULL, HFILL }}, + { "Port", "h248.annexc.port", + FT_UINT16, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_porttype, - { "PortType", "h248.annexc.porttype", - FT_UINT32, BASE_DEC, VALS(h248_pkg_annexc_porttype_values), 0, - "Port Type", HFILL }}, + { "PortType", "h248.annexc.porttype", + FT_UINT32, BASE_DEC, VALS(h248_pkg_annexc_porttype_values), 0, + "Port Type", HFILL }}, { &hf_h248_pkg_annexc_alc, - { "ALC", "h248.annexc.alc", - FT_BYTES, BASE_NONE, NULL, 0, - "AAL2 Link Characteristics", HFILL }}, + { "ALC", "h248.annexc.alc", + FT_BYTES, BASE_NONE, NULL, 0, + "AAL2 Link Characteristics", HFILL }}, { &hf_h248_pkg_annexc_sut, - { "SUT", "h248.annexc.sut", - FT_BYTES, BASE_NONE, NULL, 0, - "Served User Transport", HFILL }}, + { "SUT", "h248.annexc.sut", + FT_BYTES, BASE_NONE, NULL, 0, + "Served User Transport", HFILL }}, { &hf_h248_pkg_annexc_tci, - { "TCI", "h248.annexc.tci", - FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Test Connection Indicator", HFILL }}, + { "TCI", "h248.annexc.tci", + FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Test Connection Indicator", HFILL }}, { &hf_h248_pkg_annexc_timer_cu, - { "Timer CU", "h248.annexc.timer_cu", - FT_UINT32, BASE_DEC, NULL, 0, - "Milliseconds to hold the partially filled cell before sending", HFILL }}, + { "Timer CU", "h248.annexc.timer_cu", + FT_UINT32, BASE_DEC, NULL, 0, + "Milliseconds to hold the partially filled cell before sending", HFILL }}, { &hf_h248_pkg_annexc_maxcpssdu, - { "Max CPS SDU", "h248.annexc.maxcpssdu", - FT_UINT8, BASE_DEC, NULL, 0, - "Maximum Common Part Sublayer Service Data Unit size", HFILL }}, + { "Max CPS SDU", "h248.annexc.maxcpssdu", + FT_UINT8, BASE_DEC, NULL, 0, + "Maximum Common Part Sublayer Service Data Unit size", HFILL }}, { &hf_h248_pkg_annexc_aal1st, - { "AAL1ST", "h248.annexc.aal1st", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_aal1st_values), 0, - "AAL1 subtype", HFILL }}, + { "AAL1ST", "h248.annexc.aal1st", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_aal1st_values), 0, + "AAL1 subtype", HFILL }}, { &hf_h248_pkg_annexc_cbrr, - { "CBRR", "h248.annexc.cbrr", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_cbrr_values), 0, - "CBR rate", HFILL }}, + { "CBRR", "h248.annexc.cbrr", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_cbrr_values), 0, + "CBR rate", HFILL }}, { &hf_h248_pkg_annexc_scri, - { "SCRI", "h248.annexc.scri", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_scri_values), 0, - "Source Clock frequency Recovery Method", HFILL }}, + { "SCRI", "h248.annexc.scri", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_scri_values), 0, + "Source Clock frequency Recovery Method", HFILL }}, { &hf_h248_pkg_annexc_ecm, - { "ECM", "h248.annexc.ecm", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_ecm_values), 0, - "Error Correction Method", HFILL }}, + { "ECM", "h248.annexc.ecm", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_ecm_values), 0, + "Error Correction Method", HFILL }}, { &hf_h248_pkg_annexc_sdbt, - { "SDBT", "h248.annexc.sdbt", - FT_UINT16, BASE_DEC, NULL, 0, - "Structured Data Transfer Blocksize", HFILL }}, + { "SDBT", "h248.annexc.sdbt", + FT_UINT16, BASE_DEC, NULL, 0, + "Structured Data Transfer Blocksize", HFILL }}, { &hf_h248_pkg_annexc_pfci, - { "PFCI", "h248.annexc.pfci", - FT_UINT8, BASE_DEC, NULL, 0, - "Partially Filled Cells Identifier", HFILL }}, + { "PFCI", "h248.annexc.pfci", + FT_UINT8, BASE_DEC, NULL, 0, + "Partially Filled Cells Identifier", HFILL }}, { &hf_h248_pkg_annexc_tmr, - { "TMR", "h248.annexc.tmr", - FT_UINT8, BASE_HEX|BASE_EXT_STRING, &isup_transmission_medium_requirement_value_ext, 0, - "Transmission Medium Requirement", HFILL }}, + { "TMR", "h248.annexc.tmr", + FT_UINT8, BASE_HEX|BASE_EXT_STRING, &isup_transmission_medium_requirement_value_ext, 0, + "Transmission Medium Requirement", HFILL }}, { &hf_h248_pkg_annexc_tmrsr, - { "TMSR", "h248.annexc.tmsr", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_tmrsr_values), 0, - "Transmission Medium Requirement Subrate", HFILL }}, + { "TMSR", "h248.annexc.tmsr", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_tmrsr_values), 0, + "Transmission Medium Requirement Subrate", HFILL }}, { &hf_h248_pkg_annexc_contcheck, - { "Continuity Check", "h248.annexc.tmsr", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_contcheck_values), 0x0C, - NULL, HFILL }}, + { "Continuity Check", "h248.annexc.tmsr", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_contcheck_values), 0x0C, + NULL, HFILL }}, { &hf_h248_pkg_annexc_itc, - { "ITC", "h248.annexc.itc", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_itc_values), 0x1f, - "Information Transfer Capability", HFILL }}, + { "ITC", "h248.annexc.itc", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_itc_values), 0x1f, + "Information Transfer Capability", HFILL }}, { &hf_h248_pkg_annexc_transmode, - { "TransMode", "h248.annexc.transmode", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_transmode_values), 0x60, - "Transfer Mode", HFILL }}, + { "TransMode", "h248.annexc.transmode", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_transmode_values), 0x60, + "Transfer Mode", HFILL }}, { &hf_h248_pkg_annexc_transrate, - { "TransRate", "h248.annexc.transrate", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_transrate_values), 0x1f, - "Transfer Rate", HFILL }}, + { "TransRate", "h248.annexc.transrate", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_transrate_values), 0x1f, + "Transfer Rate", HFILL }}, { &hf_h248_pkg_annexc_mult, - { "Rate Multiplier", "h248.annexc.mult", - FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, + { "Rate Multiplier", "h248.annexc.mult", + FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_syncasync, - { "SyncAsync", "h248.annexc.syncasync", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_syncasync_values), 0x80, - "Synchronous/Asynchronous", HFILL }}, + { "SyncAsync", "h248.annexc.syncasync", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_syncasync_values), 0x80, + "Synchronous/Asynchronous", HFILL }}, { &hf_h248_pkg_annexc_negotiation, - { "UPPC", "h248.annexc.negotiation", - FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_negotiation_values), 0x40, - "Negotiation", HFILL }}, + { "UPPC", "h248.annexc.negotiation", + FT_UINT8, BASE_DEC, VALS(h248_pkg_annexc_negotiation_values), 0x40, + "Negotiation", HFILL }}, { &hf_h248_pkg_annexc_userrate, - { "Userrate", "h248.annexc.userrate", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_userrate_values), 0x1f, - "User Rate", HFILL }}, + { "Userrate", "h248.annexc.userrate", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_userrate_values), 0x1f, + "User Rate", HFILL }}, { &hf_h248_pkg_annexc_intrate, - { "UPPC", "h248.annexc.intrate", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_intrate_values), 0xc0, - "Intermediate Rate", HFILL }}, + { "UPPC", "h248.annexc.intrate", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_intrate_values), 0xc0, + "Intermediate Rate", HFILL }}, { &hf_h248_pkg_annexc_nictx, - { "nictx", "h248.annexc.nictx", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_nictx_values), 0xc0, - "Network independent clock on transmission", HFILL }}, + { "nictx", "h248.annexc.nictx", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_nictx_values), 0xc0, + "Network independent clock on transmission", HFILL }}, { &hf_h248_pkg_annexc_nicrx, - { "nicrx", "h248.annexc.nicrx", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_nicrx_values), 0xc0, - "Network independent clock on reception", HFILL }}, + { "nicrx", "h248.annexc.nicrx", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_nicrx_values), 0xc0, + "Network independent clock on reception", HFILL }}, { &hf_h248_pkg_annexc_flowconttx, - { "flowconttx", "h248.annexc.flowconttx", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_flowconttx_values), 0xc0, - "Flow Control on Transmission", HFILL }}, + { "flowconttx", "h248.annexc.flowconttx", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_flowconttx_values), 0xc0, + "Flow Control on Transmission", HFILL }}, { &hf_h248_pkg_annexc_flowcontrx, - { "flowcontrx", "h248.annexc.flowcontrx", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_flowcontrx_values), 0xc0, - "Flow Control on Reception", HFILL }}, + { "flowcontrx", "h248.annexc.flowcontrx", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_flowcontrx_values), 0xc0, + "Flow Control on Reception", HFILL }}, { &hf_h248_pkg_annexc_rateadapthdr, - { "rateadapthdr", "h248.annexc.rateadapthdr", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_rateadapthdr_values), 0xc0, - "Rate Adaptation Header/No-Header", HFILL }}, + { "rateadapthdr", "h248.annexc.rateadapthdr", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_rateadapthdr_values), 0xc0, + "Rate Adaptation Header/No-Header", HFILL }}, { &hf_h248_pkg_annexc_multiframe, - { "multiframe", "h248.annexc.multiframe", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_multiframe_values), 0xc0, - "Multiple Frame establishment support in datalink", HFILL }}, + { "multiframe", "h248.annexc.multiframe", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_multiframe_values), 0xc0, + "Multiple Frame establishment support in datalink", HFILL }}, { &hf_h248_pkg_annexc_opmode, - { "OPMODE", "h248.annexc.opmode", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_opmode_values), 0xc0, - "Mode of operation", HFILL }}, + { "OPMODE", "h248.annexc.opmode", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_opmode_values), 0xc0, + "Mode of operation", HFILL }}, { &hf_h248_pkg_annexc_llidnegot, - { "llidnegot", "h248.annexc.llidnegot", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_llidnegot_values), 0xc0, - "Logical Link Identifier negotiation", HFILL }}, + { "llidnegot", "h248.annexc.llidnegot", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_llidnegot_values), 0xc0, + "Logical Link Identifier negotiation", HFILL }}, { &hf_h248_pkg_annexc_assign, - { "llidnegot", "h248.annexc.assign", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_assign_values), 0xc0, - "Assignor/Assignee", HFILL }}, + { "llidnegot", "h248.annexc.assign", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_assign_values), 0xc0, + "Assignor/Assignee", HFILL }}, { &hf_h248_pkg_annexc_inbandneg, - { "inbandneg", "h248.annexc.inbandneg", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_inbandneg_values), 0xc0, - "In-band/Out-band negotiation", HFILL }}, + { "inbandneg", "h248.annexc.inbandneg", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_inbandneg_values), 0xc0, + "In-band/Out-band negotiation", HFILL }}, { &hf_h248_pkg_annexc_stopbits, - { "stopbits", "h248.annexc.stopbits", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_stopbits_values), 0xc0, - "Number of stop bits", HFILL }}, + { "stopbits", "h248.annexc.stopbits", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_stopbits_values), 0xc0, + "Number of stop bits", HFILL }}, { &hf_h248_pkg_annexc_databits, - { "databits", "h248.annexc.databits", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_databits_values), 0xc0, - "Number of data bits", HFILL }}, + { "databits", "h248.annexc.databits", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_databits_values), 0xc0, + "Number of data bits", HFILL }}, { &hf_h248_pkg_annexc_parity, - { "parity", "h248.annexc.parity", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_parity_values), 0xe0, - "Parity Information Bits", HFILL }}, + { "parity", "h248.annexc.parity", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_parity_values), 0xe0, + "Parity Information Bits", HFILL }}, { &hf_h248_pkg_annexc_duplexmode, - { "duplexmode", "h248.annexc.duplexmode", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_duplexmode_values), 0x80, - "Mode Duplex", HFILL }}, + { "duplexmode", "h248.annexc.duplexmode", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_duplexmode_values), 0x80, + "Mode Duplex", HFILL }}, { &hf_h248_pkg_annexc_modem, - { "modem", "h248.annexc.modem", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_modem_values), 0xfc, - "Modem Type", HFILL }}, + { "modem", "h248.annexc.modem", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_modem_values), 0xfc, + "Modem Type", HFILL }}, { &hf_h248_pkg_annexc_layer2prot, - { "layer2prot", "h248.annexc.layer2prot", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_layer2prot_values), 0x80, - "Layer 2 protocol", HFILL }}, + { "layer2prot", "h248.annexc.layer2prot", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_layer2prot_values), 0x80, + "Layer 2 protocol", HFILL }}, { &hf_h248_pkg_annexc_layer3prot, - { "layer3prot", "h248.annexc.layer3prot", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_layer3prot_values), 0x80, - "Layer 3 protocol", HFILL }}, + { "layer3prot", "h248.annexc.layer3prot", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_layer3prot_values), 0x80, + "Layer 3 protocol", HFILL }}, { &hf_h248_pkg_annexc_addlayer3prot, - { "addlayer3prot", "h248.annexc.addlayer3prot", - FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_addlayer3prot_values), 0x80, - "Additional User Information Layer 3 protocol", HFILL }}, + { "addlayer3prot", "h248.annexc.addlayer3prot", + FT_UINT8, BASE_HEX, VALS(h248_pkg_annexc_addlayer3prot_values), 0x80, + "Additional User Information Layer 3 protocol", HFILL }}, { &hf_h248_pkg_annexc_dialedn, - { "Dialed Number", "h248.annexc.dialedn", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "Dialed Number", "h248.annexc.dialedn", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_dialingn, - { "Dialing Number", "h248.annexc.dialingn", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "Dialing Number", "h248.annexc.dialingn", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_echoci, - { "ECHOCI", "h248.annexc.echoci", - FT_BYTES, BASE_NONE, NULL, 0, - "Not used", HFILL }}, + { "ECHOCI", "h248.annexc.echoci", + FT_BYTES, BASE_NONE, NULL, 0, + "Not used", HFILL }}, { &hf_h248_pkg_annexc_nci, - { "NCI", "h248.annexc.nci", - FT_UINT8, BASE_HEX, NULL, 0xff, - "Nature of Connection Indicator", HFILL }}, + { "NCI", "h248.annexc.nci", + FT_UINT8, BASE_HEX, NULL, 0xff, + "Nature of Connection Indicator", HFILL }}, { &hf_h248_pkg_annexc_USI, - { "USI", "h248.annexc.USI", - FT_BYTES, BASE_NONE, NULL, 0, - "User Service Information", HFILL }}, + { "USI", "h248.annexc.USI", + FT_BYTES, BASE_NONE, NULL, 0, + "User Service Information", HFILL }}, { &hf_h248_pkg_annexc_fmsdu, - { "fmsdu", "h248.annexc.fmsdu", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "fmsdu", "h248.annexc.fmsdu", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_bmsdu, - { "bmsdu", "h248.annexc.bmsdu", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "bmsdu", "h248.annexc.bmsdu", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_sscs, - { "sscs", "h248.annexc.sscs", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "sscs", "h248.annexc.sscs", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_pkg_annexc_sdp_v, - { "sdp_v", "h248.annexc.sdp_v", - FT_STRING, BASE_NONE, NULL, 0, - "SDP V", HFILL }}, + { "sdp_v", "h248.annexc.sdp_v", + FT_STRING, BASE_NONE, NULL, 0, + "SDP V", HFILL }}, { &hf_h248_pkg_annexc_sdp_o, - { "sdp_o", "h248.annexc.sdp_o", - FT_STRING, BASE_NONE, NULL, 0, - "SDP O", HFILL }}, + { "sdp_o", "h248.annexc.sdp_o", + FT_STRING, BASE_NONE, NULL, 0, + "SDP O", HFILL }}, { &hf_h248_pkg_annexc_sdp_s, - { "sdp_s", "h248.annexc.sdp_s", - FT_STRING, BASE_NONE, NULL, 0, - "SDP S", HFILL }}, + { "sdp_s", "h248.annexc.sdp_s", + FT_STRING, BASE_NONE, NULL, 0, + "SDP S", HFILL }}, { &hf_h248_pkg_annexc_sdp_i, - { "sdp_i", "h248.annexc.sdp_i", - FT_STRING, BASE_NONE, NULL, 0, - "SDP I", HFILL }}, + { "sdp_i", "h248.annexc.sdp_i", + FT_STRING, BASE_NONE, NULL, 0, + "SDP I", HFILL }}, { &hf_h248_pkg_annexc_sdp_u, - { "sdp_u", "h248.annexc.sdp_u", - FT_STRING, BASE_NONE, NULL, 0, - "SDP U", HFILL }}, + { "sdp_u", "h248.annexc.sdp_u", + FT_STRING, BASE_NONE, NULL, 0, + "SDP U", HFILL }}, { &hf_h248_pkg_annexc_sdp_e, - { "sdp_e", "h248.annexc.sdp_e", - FT_STRING, BASE_NONE, NULL, 0, - "SDP E", HFILL }}, + { "sdp_e", "h248.annexc.sdp_e", + FT_STRING, BASE_NONE, NULL, 0, + "SDP E", HFILL }}, { &hf_h248_pkg_annexc_sdp_p, - { "sdp_p", "h248.annexc.sdp_p", - FT_STRING, BASE_NONE, NULL, 0, - "SDP P", HFILL }}, + { "sdp_p", "h248.annexc.sdp_p", + FT_STRING, BASE_NONE, NULL, 0, + "SDP P", HFILL }}, { &hf_h248_pkg_annexc_sdp_c, - { "sdp_c", "h248.annexc.sdp_c", - FT_STRING, BASE_NONE, NULL, 0, - "SDP C", HFILL }}, + { "sdp_c", "h248.annexc.sdp_c", + FT_STRING, BASE_NONE, NULL, 0, + "SDP C", HFILL }}, { &hf_h248_pkg_annexc_sdp_b, - { "sdp_b", "h248.annexc.sdp_b", - FT_STRING, BASE_NONE, NULL, 0, - "SDP B", HFILL }}, + { "sdp_b", "h248.annexc.sdp_b", + FT_STRING, BASE_NONE, NULL, 0, + "SDP B", HFILL }}, { &hf_h248_pkg_annexc_sdp_z, - { "sdp_z", "h248.annexc.sdp_z", - FT_STRING, BASE_NONE, NULL, 0, - "SDP Z", HFILL }}, + { "sdp_z", "h248.annexc.sdp_z", + FT_STRING, BASE_NONE, NULL, 0, + "SDP Z", HFILL }}, { &hf_h248_pkg_annexc_sdp_k, - { "sdp_k", "h248.annexc.sdp_k", - FT_STRING, BASE_NONE, NULL, 0, - "SDP K", HFILL }}, + { "sdp_k", "h248.annexc.sdp_k", + FT_STRING, BASE_NONE, NULL, 0, + "SDP K", HFILL }}, { &hf_h248_pkg_annexc_sdp_a, - { "sdp_a", "h248.annexc.sdp_a", - FT_STRING, BASE_NONE, NULL, 0, - "SDP A", HFILL }}, + { "sdp_a", "h248.annexc.sdp_a", + FT_STRING, BASE_NONE, NULL, 0, + "SDP A", HFILL }}, { &hf_h248_pkg_annexc_sdp_t, - { "sdp_t", "h248.annexc.sdp_t", - FT_STRING, BASE_NONE, NULL, 0, - "SDP T", HFILL }}, + { "sdp_t", "h248.annexc.sdp_t", + FT_STRING, BASE_NONE, NULL, 0, + "SDP T", HFILL }}, { &hf_h248_pkg_annexc_sdp_r, - { "sdp_r", "h248.annexc.sdp_r", - FT_STRING, BASE_NONE, NULL, 0, - "SDP R", HFILL }}, + { "sdp_r", "h248.annexc.sdp_r", + FT_STRING, BASE_NONE, NULL, 0, + "SDP R", HFILL }}, { &hf_h248_pkg_annexc_sdp_m, - { "sdp_m", "h248.annexc.sdp_m", - FT_STRING, BASE_NONE, NULL, 0, - "SDP M", HFILL }}, + { "sdp_m", "h248.annexc.sdp_m", + FT_STRING, BASE_NONE, NULL, 0, + "SDP M", HFILL }}, { &hf_h248_pkg_annexc_olc, - { "OLC", "h248.annexc.olc", - FT_BYTES, BASE_NONE, NULL, 0, - "Open Logical Channel", HFILL }}, + { "OLC", "h248.annexc.olc", + FT_BYTES, BASE_NONE, NULL, 0, + "Open Logical Channel", HFILL }}, { &hf_h248_pkg_annexc_olcack, - { "OLCack", "h248.annexc.olcack", - FT_BYTES, BASE_NONE, NULL, 0, - "Open Logical Channel Acknowledge", HFILL }}, + { "OLCack", "h248.annexc.olcack", + FT_BYTES, BASE_NONE, NULL, 0, + "Open Logical Channel Acknowledge", HFILL }}, { &hf_h248_pkg_annexc_olccnf, - { "OLCcnf", "h248.annexc.olccnf", - FT_BYTES, BASE_NONE, NULL, 0, - "Open Logical Channel CNF", HFILL }}, + { "OLCcnf", "h248.annexc.olccnf", + FT_BYTES, BASE_NONE, NULL, 0, + "Open Logical Channel CNF", HFILL }}, { &hf_h248_pkg_annexc_olcrej, - { "OLCrej", "h248.annexc.olcrej", - FT_BYTES, BASE_NONE, NULL, 0, - "Open Logical Channel Reject", HFILL }}, + { "OLCrej", "h248.annexc.olcrej", + FT_BYTES, BASE_NONE, NULL, 0, + "Open Logical Channel Reject", HFILL }}, { &hf_h248_pkg_annexc_clc, - { "CLC", "h248.annexc.clc", - FT_BYTES, BASE_NONE, NULL, 0, - "Close Logical Channel", HFILL }}, + { "CLC", "h248.annexc.clc", + FT_BYTES, BASE_NONE, NULL, 0, + "Close Logical Channel", HFILL }}, { &hf_h248_pkg_annexc_clcack, - { "CLCack", "h248.annexc.clcack", - FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { "CLCack", "h248.annexc.clcack", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, }; static gint *ett[] = { @@ -1514,3 +1516,16 @@ void proto_register_h248_annex_c(void) { h248_register_package(&h248_annexc_package,MERGE_PKG_HIGH); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-h263.c b/epan/dissectors/packet-h263.c index a06b785cea..1b842f06b0 100644 --- a/epan/dissectors/packet-h263.c +++ b/epan/dissectors/packet-h263.c @@ -85,15 +85,15 @@ static gint ett_h263_optype = -1; const value_string h263_srcformat_vals[] = { - { H263_SRCFORMAT_FORB, "forbidden" }, - { H263_SRCFORMAT_SQCIF, "sub-QCIF 128x96" }, - { H263_SRCFORMAT_QCIF, "QCIF 176x144" }, - { H263_SRCFORMAT_CIF, "CIF 352x288" }, - { H263_SRCFORMAT_4CIF, "4CIF 704x576" }, - { H263_SRCFORMAT_16CIF, "16CIF 1408x1152" }, - { 6, "Reserved",}, - { H263_PLUSPTYPE, "extended PTYPE" }, - { 0, NULL }, + { H263_SRCFORMAT_FORB, "forbidden" }, + { H263_SRCFORMAT_SQCIF, "sub-QCIF 128x96" }, + { H263_SRCFORMAT_QCIF, "QCIF 176x144" }, + { H263_SRCFORMAT_CIF, "CIF 352x288" }, + { H263_SRCFORMAT_4CIF, "4CIF 704x576" }, + { H263_SRCFORMAT_16CIF, "16CIF 1408x1152" }, + { 6, "Reserved",}, + { H263_PLUSPTYPE, "extended PTYPE" }, + { 0, NULL }, }; /* @@ -103,67 +103,67 @@ const value_string h263_srcformat_vals[] = */ static const value_string ext_srcformat_vals[] = { - { 0, "reserved" }, - { H263_SRCFORMAT_SQCIF, "sub-QCIF 128x96" }, - { H263_SRCFORMAT_QCIF, "QCIF 176x144" }, - { H263_SRCFORMAT_CIF, "CIF 352x288" }, - { H263_SRCFORMAT_4CIF, "4CIF 704x576" }, - { H263_SRCFORMAT_16CIF, "16CIF 1408x1152" }, - { 6, "Custom source format",}, - { 7, "Reserved" }, - { 0, NULL }, + { 0, "reserved" }, + { H263_SRCFORMAT_SQCIF, "sub-QCIF 128x96" }, + { H263_SRCFORMAT_QCIF, "QCIF 176x144" }, + { H263_SRCFORMAT_CIF, "CIF 352x288" }, + { H263_SRCFORMAT_4CIF, "4CIF 704x576" }, + { H263_SRCFORMAT_16CIF, "16CIF 1408x1152" }, + { 6, "Custom source format",}, + { 7, "Reserved" }, + { 0, NULL }, }; static const value_string h263_ufep_vals[] = { - { 0, "Only MPPTYPE included" }, - { 1, "All extended PTYPE fields are included" }, - { 0, NULL }, + { 0, "Only MPPTYPE included" }, + { 1, "All extended PTYPE fields are included" }, + { 0, NULL }, }; static const true_false_string on_off_flg = { - "On", - "Off" + "On", + "Off" }; static const true_false_string picture_coding_type_flg = { - "INTER (P-picture)", - "INTRA (I-picture)" + "INTER (P-picture)", + "INTRA (I-picture)" }; static const value_string picture_coding_type_vals[] = { - { 0, "I-Frame" }, - { 1, "P-frame" }, - { 0, NULL }, + { 0, "I-Frame" }, + { 1, "P-frame" }, + { 0, NULL }, }; static const true_false_string PB_frames_mode_flg = { - "PB-frame", - "Normal I- or P-picture" + "PB-frame", + "Normal I- or P-picture" }; static const true_false_string cpm_flg = { - "On", - "Off" + "On", + "Off" }; static const true_false_string custom_pcf_flg = { - "Custom PCF", - "CIF PCF" + "Custom PCF", + "CIF PCF" }; /* Bits 1-3 Picture Type Code:*/ static const value_string picture_type_code_vals[] = { - { 0, "I-picture (INTRA)" }, - { 1, "P-picture (INTER)" }, - { 2, "Improved PB-frame (see Annex M)" }, - { 3, "B-picture (see Annex O)" }, - { 4, "EI-picture (see Annex O)" }, - { 5, "EP-picture (see Annex O)" }, - { 6, "Reserved" }, - { 7, "Reserved" }, - { 0, NULL }, + { 0, "I-picture (INTRA)" }, + { 1, "P-picture (INTER)" }, + { 2, "Improved PB-frame (see Annex M)" }, + { 3, "B-picture (see Annex O)" }, + { 4, "EI-picture (see Annex O)" }, + { 5, "EP-picture (see Annex O)" }, + { 6, "Reserved" }, + { 7, "Reserved" }, + { 0, NULL }, }; @@ -1011,16 +1011,29 @@ proto_register_h263_data(void) }, }; - static gint *ett[] = + static gint *ett[] = { - &ett_h263_payload, - &ett_h263_optype, + &ett_h263_payload, + &ett_h263_optype, }; - proto_register_subtree_array(ett, array_length(ett)); + proto_register_subtree_array(ett, array_length(ett)); proto_h263_data = proto_register_protocol("ITU-T Recommendation H.263", "H.263", "h263"); proto_register_field_array(proto_h263_data, hf, array_length(hf)); register_dissector("h263data", dissect_h263_data, proto_h263_data); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index 50a129da98..de871c7e7f 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -176,16 +176,16 @@ static expert_field ei_icmp_resp_not_found = EI_INIT; #define ICMP_PHOTURIS 40 /* ICMP UNREACHABLE */ -#define ICMP_NET_UNREACH 0 /* Network Unreachable */ -#define ICMP_HOST_UNREACH 1 /* Host Unreachable */ -#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */ -#define ICMP_PORT_UNREACH 3 /* Port Unreachable */ -#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */ -#define ICMP_SR_FAILED 5 /* Source Route failed */ -#define ICMP_NET_UNKNOWN 6 -#define ICMP_HOST_UNKNOWN 7 -#define ICMP_HOST_ISOLATED 8 -#define ICMP_NET_ANO 9 +#define ICMP_NET_UNREACH 0 /* Network Unreachable */ +#define ICMP_HOST_UNREACH 1 /* Host Unreachable */ +#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */ +#define ICMP_PORT_UNREACH 3 /* Port Unreachable */ +#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */ +#define ICMP_SR_FAILED 5 /* Source Route failed */ +#define ICMP_NET_UNKNOWN 6 +#define ICMP_HOST_UNKNOWN 7 +#define ICMP_HOST_ISOLATED 8 +#define ICMP_NET_ANO 9 #define ICMP_HOST_ANO 10 #define ICMP_NET_UNR_TOS 11 #define ICMP_HOST_UNR_TOS 12 @@ -193,7 +193,7 @@ static expert_field ei_icmp_resp_not_found = EI_INIT; #define ICMP_PREC_VIOLATION 14 /* Precedence violation */ #define ICMP_PREC_CUTOFF 15 /* Precedence cut off */ -#define ICMP_MIP_EXTENSION_PAD 0 +#define ICMP_MIP_EXTENSION_PAD 0 #define ICMP_MIP_MOB_AGENT_ADV 16 #define ICMP_MIP_PREFIX_LENGTHS 19 #define ICMP_MIP_CHALLENGE 24 @@ -202,57 +202,57 @@ static dissector_handle_t ip_handle; static dissector_handle_t data_handle; static const value_string icmp_type_str[] = { - {ICMP_ECHOREPLY, "Echo (ping) reply"}, - {1, "Reserved"}, - {2, "Reserved"}, - {ICMP_UNREACH, "Destination unreachable"}, + {ICMP_ECHOREPLY, "Echo (ping) reply"}, + {1, "Reserved"}, + {2, "Reserved"}, + {ICMP_UNREACH, "Destination unreachable"}, {ICMP_SOURCEQUENCH, "Source quench (flow control)"}, - {ICMP_REDIRECT, "Redirect"}, - {ICMP_ALTHOST, "Alternate host address"}, - {ICMP_ECHO, "Echo (ping) request"}, - {ICMP_RTRADVERT, "Router advertisement"}, - {ICMP_RTRSOLICIT, "Router solicitation"}, - {ICMP_TIMXCEED, "Time-to-live exceeded"}, - {ICMP_PARAMPROB, "Parameter problem"}, - {ICMP_TSTAMP, "Timestamp request"}, - {ICMP_TSTAMPREPLY, "Timestamp reply"}, - {ICMP_IREQ, "Information request"}, - {ICMP_IREQREPLY, "Information reply"}, - {ICMP_MASKREQ, "Address mask request"}, - {ICMP_MASKREPLY, "Address mask reply"}, - {19, "Reserved (for security)"}, - {30, "Traceroute"}, - {31, "Datagram Conversion Error"}, - {32, "Mobile Host Redirect"}, - {33, "IPv6 Where-Are-You"}, - {34, "IPv6 I-Am-Here"}, - {35, "Mobile Registration Request"}, - {36, "Mobile Registration Reply"}, - {37, "Domain Name Request"}, - {38, "Domain Name Reply"}, - {39, "SKIP"}, - {ICMP_PHOTURIS, "Photuris"}, - {41, "Experimental mobility protocols"}, + {ICMP_REDIRECT, "Redirect"}, + {ICMP_ALTHOST, "Alternate host address"}, + {ICMP_ECHO, "Echo (ping) request"}, + {ICMP_RTRADVERT, "Router advertisement"}, + {ICMP_RTRSOLICIT, "Router solicitation"}, + {ICMP_TIMXCEED, "Time-to-live exceeded"}, + {ICMP_PARAMPROB, "Parameter problem"}, + {ICMP_TSTAMP, "Timestamp request"}, + {ICMP_TSTAMPREPLY, "Timestamp reply"}, + {ICMP_IREQ, "Information request"}, + {ICMP_IREQREPLY, "Information reply"}, + {ICMP_MASKREQ, "Address mask request"}, + {ICMP_MASKREPLY, "Address mask reply"}, + {19, "Reserved (for security)"}, + {30, "Traceroute"}, + {31, "Datagram Conversion Error"}, + {32, "Mobile Host Redirect"}, + {33, "IPv6 Where-Are-You"}, + {34, "IPv6 I-Am-Here"}, + {35, "Mobile Registration Request"}, + {36, "Mobile Registration Reply"}, + {37, "Domain Name Request"}, + {38, "Domain Name Reply"}, + {39, "SKIP"}, + {ICMP_PHOTURIS, "Photuris"}, + {41, "Experimental mobility protocols"}, {0, NULL} }; static const value_string unreach_code_str[] = { - {ICMP_NET_UNREACH, "Network unreachable"}, - {ICMP_HOST_UNREACH, "Host unreachable"}, - {ICMP_PROT_UNREACH, "Protocol unreachable"}, - {ICMP_PORT_UNREACH, "Port unreachable"}, - {ICMP_FRAG_NEEDED, "Fragmentation needed"}, - {ICMP_SR_FAILED, "Source route failed"}, - {ICMP_NET_UNKNOWN, "Destination network unknown"}, - {ICMP_HOST_UNKNOWN, "Destination host unknown"}, - {ICMP_HOST_ISOLATED, "Source host isolated"}, - {ICMP_NET_ANO, "Network administratively prohibited"}, - {ICMP_HOST_ANO, "Host administratively prohibited"}, - {ICMP_NET_UNR_TOS, "Network unreachable for TOS"}, - {ICMP_HOST_UNR_TOS, "Host unreachable for TOS"}, - {ICMP_PKT_FILTERED, "Communication administratively filtered"}, + {ICMP_NET_UNREACH, "Network unreachable"}, + {ICMP_HOST_UNREACH, "Host unreachable"}, + {ICMP_PROT_UNREACH, "Protocol unreachable"}, + {ICMP_PORT_UNREACH, "Port unreachable"}, + {ICMP_FRAG_NEEDED, "Fragmentation needed"}, + {ICMP_SR_FAILED, "Source route failed"}, + {ICMP_NET_UNKNOWN, "Destination network unknown"}, + {ICMP_HOST_UNKNOWN, "Destination host unknown"}, + {ICMP_HOST_ISOLATED, "Source host isolated"}, + {ICMP_NET_ANO, "Network administratively prohibited"}, + {ICMP_HOST_ANO, "Host administratively prohibited"}, + {ICMP_NET_UNR_TOS, "Network unreachable for TOS"}, + {ICMP_HOST_UNR_TOS, "Host unreachable for TOS"}, + {ICMP_PKT_FILTERED, "Communication administratively filtered"}, {ICMP_PREC_VIOLATION, "Host precedence violation"}, - {ICMP_PREC_CUTOFF, "Precedence cutoff in effect"}, + {ICMP_PREC_CUTOFF, "Precedence cutoff in effect"}, {0, NULL} }; @@ -270,7 +270,7 @@ static const value_string alt_host_code_str[] = { }; static const value_string rtradvert_code_str[] = { - {0, "Normal router advertisement"}, + { 0, "Normal router advertisement"}, {16, "Does not route common traffic"}, {0, NULL} }; @@ -299,11 +299,11 @@ static const value_string photuris_code_str[] = { }; static const value_string mip_extensions[] = { - {ICMP_MIP_EXTENSION_PAD, "One byte padding extension"}, /* RFC 2002 */ - {ICMP_MIP_MOB_AGENT_ADV, "Mobility Agent Advertisement Extension"}, + {ICMP_MIP_EXTENSION_PAD, "One byte padding extension"}, /* RFC 2002 */ + {ICMP_MIP_MOB_AGENT_ADV, "Mobility Agent Advertisement Extension"}, /* RFC 2002 */ - {ICMP_MIP_PREFIX_LENGTHS, "Prefix Lengths Extension"}, /* RFC 2002 */ - {ICMP_MIP_CHALLENGE, "Challenge Extension"}, /* RFC 3012 */ + {ICMP_MIP_PREFIX_LENGTHS, "Prefix Lengths Extension"}, /* RFC 2002 */ + {ICMP_MIP_CHALLENGE, "Challenge Extension"}, /* RFC 3012 */ {0, NULL} }; @@ -312,8 +312,7 @@ static const value_string mip_extensions[] = { */ static const value_string interface_role_str[] = { {0, "IP interface upon which datagram arrived"}, - {1, - "sub-IP component of an IP interface upon which datagram arrived"}, + {1, "sub-IP component of an IP interface upon which datagram arrived"}, {2, "IP interface through which datagram would be forwarded"}, {3, "IP next-hop to which datagram would be forwarded"}, {0, NULL} @@ -326,13 +325,13 @@ static const value_string interface_role_str[] = { #define INT_INFO_NAME 0x02 #define INT_INFO_MTU 0x01 -#define INTERFACE_INFORMATION_OBJECT_CLASS 2 +#define INTERFACE_INFORMATION_OBJECT_CLASS 2 -#define MPLS_STACK_ENTRY_OBJECT_CLASS 1 -#define MPLS_EXTENDED_PAYLOAD_OBJECT_CLASS 0 +#define MPLS_STACK_ENTRY_OBJECT_CLASS 1 +#define MPLS_EXTENDED_PAYLOAD_OBJECT_CLASS 0 -#define MPLS_STACK_ENTRY_C_TYPE 1 -#define MPLS_EXTENDED_PAYLOAD_C_TYPE 1 +#define MPLS_STACK_ENTRY_C_TYPE 1 +#define MPLS_EXTENDED_PAYLOAD_C_TYPE 1 #define INET6_ADDRLEN 16 @@ -2016,3 +2015,16 @@ void proto_reg_handoff_icmp(void) dissector_add_uint("ip.proto", IP_PROTO_ICMP, icmp_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-ipdc.c b/epan/dissectors/packet-ipdc.c index 394c40512a..85cec8b165 100644 --- a/epan/dissectors/packet-ipdc.c +++ b/epan/dissectors/packet-ipdc.c @@ -1077,3 +1077,16 @@ proto_reg_handoff_ipdc(void) last_ipdc_port_pref = ipdc_port_pref; dissector_add_uint("tcp.port", ipdc_port_pref, ipdc_tcp_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-ismacryp.c b/epan/dissectors/packet-ismacryp.c index ebd32d5a4b..009a936d42 100644 --- a/epan/dissectors/packet-ismacryp.c +++ b/epan/dissectors/packet-ismacryp.c @@ -114,9 +114,9 @@ static gboolean user_mode = FALSE; /* selected user mode ins /* ismacryp Parameter Types */ /*static const value_string parametertypenames[] = {}; */ static const value_string modetypenames[] = { - { AAC_HBR_MODE, "aac-hbr" }, + { AAC_HBR_MODE, "aac-hbr" }, { MPEG4_VIDEO_MODE, "mpeg4-video" }, - { AVC_VIDEO_MODE, "avc-video" }, + { AVC_VIDEO_MODE, "avc-video" }, { 0, NULL} }; /* The following hf_* variables are used to hold the Wireshark IDs of @@ -1033,3 +1033,16 @@ void proto_reg_handoff_ismacryp(void) } } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-linx.c b/epan/dissectors/packet-linx.c index 5bca88af71..a2ec021708 100644 --- a/epan/dissectors/packet-linx.c +++ b/epan/dissectors/packet-linx.c @@ -239,9 +239,9 @@ static const value_string linx_long_rlnh_names[]={ }; static const value_string linx_rlnh_reply[] = { - { 0, "Version supported"}, - { 1, "Version NOT supported"}, - { 0, NULL} + { 0, "Version supported"}, + { 1, "Version NOT supported"}, + { 0, NULL} }; static const value_string linx_boolean[] = { @@ -392,7 +392,7 @@ dissect_linx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) : dst hw addr followed by src hw addr : : : +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - : : + : : : Feature negotiation string (null terminated) : : : +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -1044,3 +1044,16 @@ proto_reg_handoff_linx_tcp(void) linx_tcp_handle = create_dissector_handle(dissect_linx_tcp, proto_linx_tcp); dissector_add_uint("tcp.port", TCP_PORT_LINX, linx_tcp_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-lmp.c b/epan/dissectors/packet-lmp.c index 42d452def6..65f12aa247 100644 --- a/epan/dissectors/packet-lmp.c +++ b/epan/dissectors/packet-lmp.c @@ -158,53 +158,53 @@ static const value_string message_type_vals[] = { /*------------------------------------------------------------------------------ * LMP object classes */ -#define LMP_CLASS_NULL 0 - -#define LMP_CLASS_CCID 1 -#define LMP_CLASS_NODE_ID 2 -#define LMP_CLASS_LINK_ID 3 -#define LMP_CLASS_INTERFACE_ID 4 -#define LMP_CLASS_MESSAGE_ID 5 -#define LMP_CLASS_CONFIG 6 -#define LMP_CLASS_HELLO 7 -#define LMP_CLASS_BEGIN_VERIFY 8 -#define LMP_CLASS_BEGIN_VERIFY_ACK 9 -#define LMP_CLASS_VERIFY_ID 10 -#define LMP_CLASS_TE_LINK 11 -#define LMP_CLASS_DATA_LINK 12 -#define LMP_CLASS_CHANNEL_STATUS 13 -#define LMP_CLASS_CHANNEL_STATUS_REQUEST 14 -#define LMP_LAST_CONTIGUOUS_CLASS LMP_CLASS_CHANNEL_STATUS_REQUEST -#define LMP_CLASS_ERROR 20 +#define LMP_CLASS_NULL 0 + +#define LMP_CLASS_CCID 1 +#define LMP_CLASS_NODE_ID 2 +#define LMP_CLASS_LINK_ID 3 +#define LMP_CLASS_INTERFACE_ID 4 +#define LMP_CLASS_MESSAGE_ID 5 +#define LMP_CLASS_CONFIG 6 +#define LMP_CLASS_HELLO 7 +#define LMP_CLASS_BEGIN_VERIFY 8 +#define LMP_CLASS_BEGIN_VERIFY_ACK 9 +#define LMP_CLASS_VERIFY_ID 10 +#define LMP_CLASS_TE_LINK 11 +#define LMP_CLASS_DATA_LINK 12 +#define LMP_CLASS_CHANNEL_STATUS 13 +#define LMP_CLASS_CHANNEL_STATUS_REQUEST 14 +#define LMP_LAST_CONTIGUOUS_CLASS LMP_CLASS_CHANNEL_STATUS_REQUEST +#define LMP_CLASS_ERROR 20 #define LMP_CLASS_TRACE 21 #define LMP_CLASS_TRACE_REQ 22 #define LMP_CLASS_SERVICE_CONFIG 51 #define LMP_CLASS_DA_DCN_ADDRESS 248 #define LMP_CLASS_LOCAL_LAD_INFO 249 -#define LMP_CLASS_MAX 250 +#define LMP_CLASS_MAX 250 static const value_string lmp_class_vals[] = { - {LMP_CLASS_CCID, "CCID"}, - {LMP_CLASS_NODE_ID, "NODE_ID"}, - {LMP_CLASS_LINK_ID, "LINK_ID"}, - {LMP_CLASS_INTERFACE_ID, "INTERFACE_ID"}, - {LMP_CLASS_MESSAGE_ID, "MESSAGE_ID"}, - {LMP_CLASS_CONFIG, "CONFIG"}, - {LMP_CLASS_HELLO, "HELLO"}, - {LMP_CLASS_BEGIN_VERIFY, "BEGIN_VERIFY"}, - {LMP_CLASS_BEGIN_VERIFY_ACK, "BEGIN_VERIFY_ACK"}, - {LMP_CLASS_VERIFY_ID, "VERIFY_ID"}, - {LMP_CLASS_TE_LINK, "TE_LINK"}, - {LMP_CLASS_DATA_LINK, "DATA_LINK"}, - {LMP_CLASS_CHANNEL_STATUS, "CHANNEL_STATUS"}, + {LMP_CLASS_CCID, "CCID"}, + {LMP_CLASS_NODE_ID, "NODE_ID"}, + {LMP_CLASS_LINK_ID, "LINK_ID"}, + {LMP_CLASS_INTERFACE_ID, "INTERFACE_ID"}, + {LMP_CLASS_MESSAGE_ID, "MESSAGE_ID"}, + {LMP_CLASS_CONFIG, "CONFIG"}, + {LMP_CLASS_HELLO, "HELLO"}, + {LMP_CLASS_BEGIN_VERIFY, "BEGIN_VERIFY"}, + {LMP_CLASS_BEGIN_VERIFY_ACK, "BEGIN_VERIFY_ACK"}, + {LMP_CLASS_VERIFY_ID, "VERIFY_ID"}, + {LMP_CLASS_TE_LINK, "TE_LINK"}, + {LMP_CLASS_DATA_LINK, "DATA_LINK"}, + {LMP_CLASS_CHANNEL_STATUS, "CHANNEL_STATUS"}, {LMP_CLASS_CHANNEL_STATUS_REQUEST, "CHANNEL_STATUS_REQUEST"}, - {LMP_CLASS_ERROR, "ERROR"}, - {LMP_CLASS_TRACE, "TRACE"}, - {LMP_CLASS_TRACE_REQ, "TRACE_REQ"}, - {LMP_CLASS_SERVICE_CONFIG, "SERVICE_CONFIG"}, - {LMP_CLASS_DA_DCN_ADDRESS, "DA_DCN_ADDRESS"}, - {LMP_CLASS_LOCAL_LAD_INFO, "LOCAL_LAD_INFO"}, + {LMP_CLASS_ERROR, "ERROR"}, + {LMP_CLASS_TRACE, "TRACE"}, + {LMP_CLASS_TRACE_REQ, "TRACE_REQ"}, + {LMP_CLASS_SERVICE_CONFIG, "SERVICE_CONFIG"}, + {LMP_CLASS_DA_DCN_ADDRESS, "DA_DCN_ADDRESS"}, + {LMP_CLASS_LOCAL_LAD_INFO, "LOCAL_LAD_INFO"}, {0, NULL} }; @@ -515,16 +515,16 @@ lmp_valid_class(int lmp_class) { /* Contiguous classes */ if (lmp_class > LMP_CLASS_NULL && lmp_class <= LMP_LAST_CONTIGUOUS_CLASS) - return 1; + return 1; /* Noncontiguous classes */ if (lmp_class == LMP_CLASS_ERROR || lmp_class == LMP_CLASS_TRACE || lmp_class == LMP_CLASS_TRACE_REQ || - lmp_class == LMP_CLASS_SERVICE_CONFIG || + lmp_class == LMP_CLASS_SERVICE_CONFIG || lmp_class == LMP_CLASS_DA_DCN_ADDRESS || lmp_class == LMP_CLASS_LOCAL_LAD_INFO) - return 1; + return 1; return 0; } @@ -536,27 +536,27 @@ lmp_msg_to_filter_num(int msg_type) return LMPF_MSG + msg_type; switch (msg_type) { - case LMP_MSG_SERVICE_CONFIG: + case LMP_MSG_SERVICE_CONFIG: return LMPF_MSG_SERVICE_CONFIG; - case LMP_MSG_SERVICE_CONFIG_ACK: + case LMP_MSG_SERVICE_CONFIG_ACK: return LMPF_MSG_SERVICE_CONFIG_ACK; - case LMP_MSG_SERVICE_CONFIG_NACK: + case LMP_MSG_SERVICE_CONFIG_NACK: return LMPF_MSG_SERVICE_CONFIG_NACK; - case LMP_MSG_DISCOVERY_RESP: + case LMP_MSG_DISCOVERY_RESP: return LMPF_MSG_DISCOVERY_RESP; - case LMP_MSG_DISCOVERY_RESP_ACK: + case LMP_MSG_DISCOVERY_RESP_ACK: return LMPF_MSG_DISCOVERY_RESP_ACK; - case LMP_MSG_DISCOVERY_RESP_NACK: + case LMP_MSG_DISCOVERY_RESP_NACK: return LMPF_MSG_DISCOVERY_RESP_NACK; - default: - return -1; - } + default: + return -1; + } } @@ -585,28 +585,28 @@ lmp_class_to_filter_num(int lmp_class) case LMP_CLASS_DATA_LINK: case LMP_CLASS_CHANNEL_STATUS: case LMP_CLASS_CHANNEL_STATUS_REQUEST: - return LMPF_OBJECT + lmp_class; + return LMPF_OBJECT + lmp_class; case LMP_CLASS_ERROR: - return LMPF_CLASS_ERROR; + return LMPF_CLASS_ERROR; case LMP_CLASS_TRACE: - return LMPF_CLASS_TRACE; + return LMPF_CLASS_TRACE; case LMP_CLASS_TRACE_REQ: - return LMPF_CLASS_TRACE_REQ; + return LMPF_CLASS_TRACE_REQ; case LMP_CLASS_SERVICE_CONFIG: - return LMPF_CLASS_SERVICE_CONFIG; + return LMPF_CLASS_SERVICE_CONFIG; case LMP_CLASS_DA_DCN_ADDRESS: - return LMPF_CLASS_DA_DCN_ADDRESS; + return LMPF_CLASS_DA_DCN_ADDRESS; case LMP_CLASS_LOCAL_LAD_INFO: - return LMPF_CLASS_LOCAL_LAD_INFO; + return LMPF_CLASS_LOCAL_LAD_INFO; default: - return -1; + return -1; } } @@ -647,17 +647,17 @@ static gint lmp_subtree[NUM_LMP_SUBTREES]; static int lmp_class_to_subtree(int lmp_class) { if (lmp_valid_class(lmp_class)) { - if (lmp_class == LMP_CLASS_SERVICE_CONFIG) { - return lmp_subtree[LMP_TREE_CLASS_START + LMP_CLASS_SERVICE_CONFIG]; - } - if (lmp_class == LMP_CLASS_DA_DCN_ADDRESS) { - return lmp_subtree[LMP_TREE_CLASS_START + LMP_CLASS_DA_DCN_ADDRESS]; - } - if (lmp_class == LMP_CLASS_LOCAL_LAD_INFO) { - return lmp_subtree[LMP_TREE_CLASS_START + LMP_CLASS_LOCAL_LAD_INFO]; - } - - return lmp_subtree[LMP_TREE_CLASS_START + lmp_class]; + if (lmp_class == LMP_CLASS_SERVICE_CONFIG) { + return lmp_subtree[LMP_TREE_CLASS_START + LMP_CLASS_SERVICE_CONFIG]; + } + if (lmp_class == LMP_CLASS_DA_DCN_ADDRESS) { + return lmp_subtree[LMP_TREE_CLASS_START + LMP_CLASS_DA_DCN_ADDRESS]; + } + if (lmp_class == LMP_CLASS_LOCAL_LAD_INFO) { + return lmp_subtree[LMP_TREE_CLASS_START + LMP_CLASS_LOCAL_LAD_INFO]; + } + + return lmp_subtree[LMP_TREE_CLASS_START + lmp_class]; } return -1; } @@ -700,1267 +700,1267 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) val_to_str(message_type, message_type_vals, "Unknown (%u). ")); if (tree) { - msg_length = tvb_get_ntohs(tvb, offset+4); - ti = proto_tree_add_item(tree, proto_lmp, tvb, offset, msg_length, - ENC_NA); - lmp_tree = proto_item_add_subtree(ti, lmp_subtree[LMP_TREE_MAIN]); - lmp_header_tree = proto_tree_add_subtree_format(lmp_tree, tvb, offset, 12, - lmp_subtree[LMP_TREE_HEADER], NULL, "LMP Header. %s", - val_to_str(message_type, message_type_vals, "Unknown Message (%u). ")); - proto_tree_add_text(lmp_header_tree, tvb, offset, 1, "LMP Version: %u", - version); - ti = proto_tree_add_text(lmp_header_tree, tvb, offset+2, 1, "Flags: %02x", - flags); - lmp_header_flags_tree = proto_item_add_subtree(ti, lmp_subtree[LMP_TREE_HEADER_FLAGS]); - proto_tree_add_boolean(lmp_header_flags_tree, hf_lmp_filter[LMPF_HDR_FLAGS_CC_DOWN], - tvb, offset+2, 1, flags); - proto_tree_add_boolean(lmp_header_flags_tree, hf_lmp_filter[LMPF_HDR_FLAGS_REBOOT], - tvb, offset+2, 1, flags); - msg_item = proto_tree_add_uint(lmp_header_tree, hf_lmp_filter[LMPF_MSG], tvb, - offset+3, 1, message_type); - proto_tree_add_text(lmp_header_tree, tvb, offset+4, 2, "Length: %d bytes", - msg_length); -/* if (LMPF_MSG + message_type < LMPF_MSG_MAX && message_type > 0) {*/ + msg_length = tvb_get_ntohs(tvb, offset+4); + ti = proto_tree_add_item(tree, proto_lmp, tvb, offset, msg_length, ENC_NA); + lmp_tree = proto_item_add_subtree(ti, lmp_subtree[LMP_TREE_MAIN]); + lmp_header_tree = proto_tree_add_subtree_format( + lmp_tree, tvb, offset, 12, + lmp_subtree[LMP_TREE_HEADER], NULL, "LMP Header. %s", + val_to_str(message_type, message_type_vals, "Unknown Message (%u). ")); + proto_tree_add_text(lmp_header_tree, tvb, offset, 1, "LMP Version: %u", + version); + ti = proto_tree_add_text(lmp_header_tree, tvb, offset+2, 1, "Flags: %02x", + flags); + lmp_header_flags_tree = proto_item_add_subtree(ti, lmp_subtree[LMP_TREE_HEADER_FLAGS]); + proto_tree_add_boolean(lmp_header_flags_tree, hf_lmp_filter[LMPF_HDR_FLAGS_CC_DOWN], + tvb, offset+2, 1, flags); + proto_tree_add_boolean(lmp_header_flags_tree, hf_lmp_filter[LMPF_HDR_FLAGS_REBOOT], + tvb, offset+2, 1, flags); + msg_item = proto_tree_add_uint(lmp_header_tree, hf_lmp_filter[LMPF_MSG], tvb, + offset+3, 1, message_type); + proto_tree_add_text(lmp_header_tree, tvb, offset+4, 2, "Length: %d bytes", + msg_length); +/* if (LMPF_MSG + message_type < LMPF_MSG_MAX && message_type > 0) {*/ /* this "if" is still a hack, but compared to the former one at least correct */ if ((message_type >= LMP_MSG_CONFIG && message_type <= LMP_MSG_CHANNEL_STATUS_RESP) || (message_type >= LMP_MSG_SERVICE_CONFIG && message_type <= LMP_MSG_SERVICE_CONFIG_NACK) || (message_type >= LMP_MSG_DISCOVERY_RESP && message_type <= LMP_MSG_DISCOVERY_RESP_NACK) ) { - hidden_item = proto_tree_add_boolean(lmp_header_tree, - hf_lmp_filter[lmp_msg_to_filter_num(message_type)], - tvb, offset+3, 1, 1); - PROTO_ITEM_SET_HIDDEN(hidden_item); - } else { - expert_add_info_format(pinfo, msg_item, &ei_lmp_invalid_msg_type, - "Invalid message type: %u", message_type); - return tvb_length(tvb); - } - - if (lmp_checksum_config) { - cksum = tvb_get_ntohs(tvb, offset+6); - ti = proto_tree_add_item(lmp_header_tree, hf_lmp_filter[LMPF_CHECKSUM], tvb, - offset+6, 2, ENC_BIG_ENDIAN); - if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) { - /* The packet isn't part of a fragmented datagram and isn't truncated, so we can checksum it. */ - SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, msg_length); - computed_cksum = in_cksum(cksum_vec, 1); - - if (computed_cksum == 0) { - proto_item_append_text( ti, " [correct]"); - } - else { - expert_add_info_format(pinfo, ti, &ei_lmp_checksum_incorrect, "[incorrect, should be 0x%04x]", - in_cksum_shouldbe(cksum, computed_cksum)); - } - } - } else { - proto_tree_add_text(lmp_header_tree, tvb, offset+6, 2, "No checksum"); - } - - offset += 8; - len = 8; - while (len < msg_length) { - guint8 lmp_class; - guint8 type; - guint8 negotiable; - int filter_num; - const char *object_type; - - obj_length = tvb_get_ntohs(tvb, offset+2); - lmp_class = tvb_get_guint8(tvb, offset+1); - type = tvb_get_guint8(tvb, offset); - negotiable = (type >> 7); type &= 0x7f; - object_type = val_to_str_const(lmp_class, lmp_class_vals, "Unknown"); - hidden_item = proto_tree_add_uint(lmp_tree, hf_lmp_filter[LMPF_OBJECT], tvb, - offset, 1, lmp_class); - PROTO_ITEM_SET_GENERATED(hidden_item); - filter_num = lmp_class_to_filter_num(lmp_class); - if (filter_num != -1 && lmp_valid_class(lmp_class)) { - ti = proto_tree_add_item(lmp_tree, - hf_lmp_filter[filter_num], - tvb, offset, obj_length, ENC_NA); /* all possibilities are FT_NONE */ - } else { - expert_add_info_format(pinfo, hidden_item, &ei_lmp_invalid_class, - "Invalid class: %u", lmp_class); - return tvb_length(tvb); - } - lmp_object_tree = proto_item_add_subtree(ti, lmp_class_to_subtree(lmp_class)); - - lmp_object_header_tree = proto_tree_add_subtree_format(lmp_object_tree, tvb, offset, 4, - lmp_subtree[LMP_TREE_OBJECT_HEADER], &ti2, - "Header. Class %d, C-Type %d, Length %d, %s", - lmp_class, type, obj_length, - negotiable ? "Negotiable" : "Not Negotiable"); - - proto_tree_add_text(lmp_object_header_tree, tvb, offset, 1, - negotiable ? "Negotiable" : "Not Negotiable"); - proto_tree_add_text(lmp_object_header_tree, tvb, offset+2, 2, - "Length: %u", obj_length); - proto_tree_add_text(lmp_object_header_tree, tvb, offset+1, 1, - "Object Class: %u - %s", - lmp_class, object_type); - proto_tree_add_uint(lmp_object_header_tree, hf_lmp_filter[LMPF_VAL_CTYPE], - tvb, offset, 1, type); - offset2 = offset+4; - mylen = obj_length - 4; - - switch (lmp_class) { - - case LMP_CLASS_NULL: - break; - - case LMP_CLASS_CCID: - switch(type) { - - case 1: - l = LMPF_VAL_LOCAL_CCID; - proto_item_append_text(ti, ": %d", tvb_get_ntohl(tvb, offset2)); - proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, tvb_get_ntohl(tvb, offset2)); - break; - - case 2: - l = LMPF_VAL_REMOTE_CCID; - proto_item_append_text(ti, ": %d", tvb_get_ntohl(tvb, offset2)); - proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, tvb_get_ntohl(tvb, offset2)); - break; - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_NODE_ID: - switch(type) { - - case 1: - l = LMPF_VAL_LOCAL_NODE_ID; - proto_item_append_text(ti, ": %s", tvb_ip_to_str(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, ENC_BIG_ENDIAN); - break; - - case 2: - l = LMPF_VAL_REMOTE_NODE_ID; - proto_item_append_text(ti, ": %s", tvb_ip_to_str(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, ENC_BIG_ENDIAN); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_LINK_ID: - - switch(type) { - - case 1: - case 2: - l = (type == 1)? LMPF_VAL_LOCAL_LINK_ID_IPV4: - LMPF_VAL_REMOTE_LINK_ID_IPV4; - proto_item_append_text(ti, ": IPv4 %s", tvb_ip_to_str(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, ENC_BIG_ENDIAN); - break; - - case 3: - case 4: - l = (type == 3)? LMPF_VAL_LOCAL_LINK_ID_IPV6: - LMPF_VAL_REMOTE_LINK_ID_IPV6; - proto_item_append_text(ti, ": IPv6 %s", tvb_ip6_to_str(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 16, ENC_NA); - break; - case 5: - case 6: - l = (type == 5)? LMPF_VAL_LOCAL_LINK_ID_UNNUM: - LMPF_VAL_REMOTE_LINK_ID_UNNUM; - proto_item_append_text(ti, ": Unnumbered %d", - tvb_get_ntohl(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, ENC_BIG_ENDIAN); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_INTERFACE_ID: - - switch(type) { - - case 1: - case 2: - l = (type == 1)? LMPF_VAL_LOCAL_INTERFACE_ID_IPV4: - LMPF_VAL_REMOTE_INTERFACE_ID_IPV4; - proto_item_append_text(ti, ": IPv4 %s", tvb_ip_to_str(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, ENC_BIG_ENDIAN); - break; - - case 3: - case 4: - l = (type == 3)? LMPF_VAL_LOCAL_INTERFACE_ID_IPV6: - LMPF_VAL_REMOTE_INTERFACE_ID_IPV6; - proto_item_append_text(ti, ": IPv6 %s", tvb_ip6_to_str(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 16, ENC_NA); - break; - - case 5: - case 6: - l = (type == 5)? LMPF_VAL_LOCAL_INTERFACE_ID_UNNUM: - LMPF_VAL_REMOTE_INTERFACE_ID_UNNUM; - proto_item_append_text(ti, ": Unnumbered %d", - tvb_get_ntohl(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, ENC_BIG_ENDIAN); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_MESSAGE_ID: - - switch(type) { - - case 1: - - l = LMPF_VAL_MESSAGE_ID; - proto_item_append_text(ti, ": %d", tvb_get_ntohl(tvb, offset2)); - proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, tvb_get_ntohl(tvb, offset2)); - break; - - case 2: - l = LMPF_VAL_MESSAGE_ID_ACK; - proto_item_append_text(ti, ": %d", tvb_get_ntohl(tvb, offset2)); - proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[l], tvb, - offset2, 4, tvb_get_ntohl(tvb, offset2)); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_CONFIG: - - switch(type) { - - case 1: - proto_item_append_text(ti, ": HelloInterval: %d, HelloDeadInterval: %d", - tvb_get_ntohs(tvb, offset2), - tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_CONFIG_HELLO], - tvb, offset2, 2, tvb_get_ntohs(tvb, offset2)); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_CONFIG_HELLO_DEAD], - tvb, offset2+2, 2, - tvb_get_ntohs(tvb, offset2+2)); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_HELLO: - - switch(type) { - - case 1: - proto_item_append_text(ti, ": TxSeq %d, RxSeq: %d", - tvb_get_ntohl(tvb, offset2), - tvb_get_ntohl(tvb, offset2+4)); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_HELLO_TXSEQ], - tvb, offset2, 4, - tvb_get_ntohl(tvb, offset2)); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_HELLO_RXSEQ], - tvb, offset2+4, 4, - tvb_get_ntohl(tvb, offset2+4)); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_BEGIN_VERIFY: - - switch(type) { - - case 1: - l = tvb_get_ntohs(tvb, offset2); - ti2 = proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS], - tvb, offset2, 2, ENC_BIG_ENDIAN); - - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_BEGIN_VERIFY_FLAGS]); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS_ALL_LINKS], - tvb, offset2, 2, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS_LINK_TYPE], - tvb, offset2, 2, l); - proto_tree_add_text(lmp_object_tree, tvb, offset2+2, 2, - "Verify Interval: %d ms", - tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(lmp_object_tree, tvb, offset2+4, 4, - "Number of Data Links: %d", - tvb_get_ntohl(tvb, offset2+4)); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_ENCTYPE], - tvb, offset2+8, 1, ENC_BIG_ENDIAN); - proto_tree_add_text(lmp_object_tree, tvb, offset2+10, 2, - "Verify Transport Mechanism: 0x%0x", - tvb_get_ntohs(tvb, offset2+10)); - proto_tree_add_text(lmp_object_tree, tvb, offset2+12, 4, - "Transmission Rate: %.3f Mbps", - tvb_get_ntohieee_float(tvb, offset2+12)*8/1000000); - proto_tree_add_text(lmp_object_tree, tvb, offset2+16, 4, - "Wavelength: %d", - tvb_get_ntohl(tvb, offset2+16)); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_BEGIN_VERIFY_ACK: - - switch(type) { - - case 1: - proto_item_append_text(ti, ": VerifyDeadInterval: %d, TransportResponse: 0x%0x", - tvb_get_ntohs(tvb, offset2), - tvb_get_ntohs(tvb, offset2+2)); - proto_tree_add_text(lmp_object_tree, tvb, offset2, 2, - "VerifyDeadInterval: %d ms", - tvb_get_ntohs(tvb, offset2)); - proto_tree_add_text(lmp_object_tree, tvb, offset2+2, 2, - "Verify Transport Response: 0x%0x", - tvb_get_ntohs(tvb, offset2+2)); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_VERIFY_ID: - - switch(type) { - - case 1: - proto_item_append_text(ti, ": %d", - tvb_get_ntohl(tvb, offset2)); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_VERIFY_ID], - tvb, offset2, 4, - tvb_get_ntohl(tvb, offset2)); - break; - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_TE_LINK: - l = tvb_get_guint8(tvb, offset2); - ti2 = proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS], - tvb, offset2, 1, l); - - proto_item_append_text(ti2, ": %s%s", - (l&0x01) ? "Fault-Mgmt-Supported " : "", - (l&0x02) ? "Link-Verification-Supported " : ""); - - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_TE_LINK_FLAGS]); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS_FAULT_MGMT], - tvb, offset2, 1, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS_LINK_VERIFY], - tvb, offset2, 1, l); - switch(type) { - - case 1: - proto_item_append_text(ti, ": IPv4: Local %s, Remote %s", - tvb_ip_to_str(tvb, offset2+4), - tvb_ip_to_str(tvb, offset2+8)); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_IPV4], - tvb, offset2+4, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_IPV4], - tvb, offset2+8, 4, ENC_BIG_ENDIAN); - break; - - case 2: - proto_item_append_text(ti, ": IPv6: Local %s, Remote %s", - tvb_ip6_to_str(tvb, offset2+4), - tvb_ip6_to_str(tvb, offset2+20)); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_IPV6], - tvb, offset2+4, 16, ENC_NA); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_IPV6], - tvb, offset2+20, 16, ENC_NA); - break; - - case 3: - proto_item_append_text(ti, ": Unnumbered: Local %d, Remote %d", - tvb_get_ntohl(tvb, offset2+4), - tvb_get_ntohl(tvb, offset2+8)); - - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_UNNUM], - tvb, offset2+4, 4, ENC_BIG_ENDIAN); - - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_UNNUM], - tvb, offset2+8, 4, ENC_BIG_ENDIAN); - break; - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_DATA_LINK: - - l = tvb_get_guint8(tvb, offset2); - ti2 = proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS], - tvb, offset2, 1, l); - proto_item_append_text(ti2, ": %s%s", - (l&0x01) ? "Interface-Type-Port " : "Interface-Type-Component-Link ", - (l&0x02) ? "Allocated " : "Unallocated "); - - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_DATA_LINK_FLAGS]); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS_PORT], - tvb, offset2, 1, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS_ALLOCATED], - tvb, offset2, 1, l); - switch(type) { - - case 1: - proto_item_append_text(ti, ": IPv4: Local %s, Remote %s", - tvb_ip_to_str(tvb, offset2+4), - tvb_ip_to_str(tvb, offset2+8)); - - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_DATA_LINK_LOCAL_IPV4], - tvb, offset2+4, 4, ENC_BIG_ENDIAN); - - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_DATA_LINK_REMOTE_IPV4], - tvb, offset2+8, 4, ENC_BIG_ENDIAN); - l = 12; - break; - - case 2: - proto_item_append_text(ti, ": IPv6: Local %s, Remote %s", - tvb_ip6_to_str(tvb, offset2+4), - tvb_ip6_to_str(tvb, offset2+8)); - proto_tree_add_text(lmp_object_tree, tvb, offset2+4, 16, - "Data-Link Local ID - IPv6: %s", - tvb_ip6_to_str(tvb, offset2)); - proto_tree_add_text(lmp_object_tree, tvb, offset2+20,16, - "Data-Link Remote ID - IPv6: %s", - tvb_ip6_to_str(tvb, offset2+4)); - l = 36; - break; - - case 3: - proto_item_append_text(ti, ": Unnumbered: Local %d, Remote %d", - tvb_get_ntohl(tvb, offset2+4), - tvb_get_ntohl(tvb, offset2+8)); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_DATA_LINK_LOCAL_UNNUM], - tvb, offset2+4, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_DATA_LINK_REMOTE_UNNUM], - tvb, offset2+8, 4, ENC_BIG_ENDIAN); - l = 12; - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - - while (l < obj_length - 4) { - mylen = tvb_get_guint8(tvb, offset2+l+1); - ti2 = proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ], - tvb, offset2+l, mylen, ENC_NA); - lmp_subobj_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_DATA_LINK_SUBOBJ]); - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 1, - "Subobject Type: %d", - tvb_get_guint8(tvb, offset2+l)); - - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+1, 1, - "Subobject Length: %d", mylen); - switch(tvb_get_guint8(tvb, offset2+l)) { - - case 1: - - proto_item_set_text(ti2, "Interface Switching Capability: " - "Switching Cap: %s, Encoding Type: %s, " - "Min BW: %.3f Mbps, Max BW: %.3f Mbps", - rval_to_str(tvb_get_guint8(tvb, offset2+l+2), - gmpls_switching_type_rvals, "Unknown (%d)"), - rval_to_str(tvb_get_guint8(tvb, offset2+l+3), - gmpls_lsp_enc_rvals, "Unknown (%d)"), - tvb_get_ntohieee_float(tvb, offset2+l+4)*8/1000000, - tvb_get_ntohieee_float(tvb, offset2+l+8)*8/1000000); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ_SWITCHING_TYPE], - tvb, offset2+l+2, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ_LSP_ENCODING], - tvb, offset2+l+3, 1, ENC_BIG_ENDIAN); - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+4, 4, - "Minimum Reservable Bandwidth: %.3f Mbps", - tvb_get_ntohieee_float(tvb, offset2+l+4)*8/1000000); - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+8, 4, - "Maximum Reservable Bandwidth: %.3f Mbps", - tvb_get_ntohieee_float(tvb, offset2+l+8)*8/1000000); - break; - - case 2: - proto_item_set_text(ti2, "Wavelength: %d", - tvb_get_ntohl(tvb, offset2+l+2)); - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+4, 4, - "Wavelength: %d", - tvb_get_ntohl(tvb, offset2+l+4)); - break; - - default: - proto_tree_add_item(lmp_subobj_tree, hf_lmp_data, tvb, offset2+l, - tvb_get_guint8(tvb, offset2+l+1), ENC_NA); - break; - } - if (tvb_get_guint8(tvb, offset2+l+1) < 1) - THROW(ReportedBoundsError); - l += tvb_get_guint8(tvb, offset2+l+1); - } - - break; - - case LMP_CLASS_CHANNEL_STATUS: - - k = 0; j = 0; - - switch(type) { - - case 1: - case 3: - k = 8; break; - - case 2: - k = 20; break; - } - - if (!k) - break; - - for (l=0; l<obj_length - 4; ) { - - lmp_subobj_tree = proto_tree_add_subtree(lmp_object_tree, tvb, offset2+l, k, - lmp_subtree[LMP_TREE_CHANNEL_STATUS_ID], &ti2, "Interface-Id"); - switch(type) { - - case 1: - if (j < 4) - proto_item_append_text(ti, ": [IPv4-%s", - tvb_ip_to_str(tvb, offset2+l)); - proto_item_append_text(ti2, ": IPv4 %s", - tvb_ip_to_str(tvb, offset2+l)); - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 4, - "Interface ID: IPv4: %s", - tvb_ip_to_str(tvb, offset2+l)); - l += 4; - break; - - case 2: - if (j < 4) - proto_item_append_text(ti, ": [IPv6-%s", tvb_ip6_to_str(tvb, offset2+l)); - proto_item_append_text(ti2, ": IPv6 %s", tvb_ip6_to_str(tvb, offset2+l)); - proto_tree_add_text(lmp_subobj_tree, tvb, offset2, 16, "Interface ID: IPv6: %s", - tvb_ip6_to_str(tvb, offset2+l)); - l += 16; - break; - - case 3: - if (j < 4) - proto_item_append_text(ti, ": [Unnum-%d", - tvb_get_ntohl(tvb, offset2+l)); - proto_item_append_text(ti, ": Unnumbered %d", - tvb_get_ntohl(tvb, offset2+l)); - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 4, - "Interface ID: Unnumbered: %d", - tvb_get_ntohl(tvb, offset2+l)); - l += 4; - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2+l, obj_length-4-l, ENC_NA); - break; - } - if (l == obj_length - 4) break; - - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 1, - tvb_get_guint8(tvb, offset2+l) & 0x80 ? - "Link Allocated - Active Monitoring" : - "Link Not Allocated"); - if (j < 4) - proto_item_append_text(ti, "-%s,%s], ", - tvb_get_guint8(tvb, offset2+l) & 0x80 ? "Act" : "NA", - val_to_str(tvb_get_ntohl(tvb, offset2+l) & 0x7fffffff, - channel_status_short_str, "UNK (%u).")); - proto_item_append_text(ti2, ": %s, ", - tvb_get_guint8(tvb, offset2+l) & 0x80 ? "Active" : "Not Active"); - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 4, - "Channel Status: %s", - val_to_str(tvb_get_ntohl(tvb, offset2+l) & 0x7fffffff, - channel_status_str, "Unknown (%u). ")); - proto_item_append_text(ti2, "%s", val_to_str(tvb_get_ntohl(tvb, offset2+l) & 0x7fffffff, - channel_status_str, "Unknown (%u). ")); - j++; - l += 4; - if (j==4 && l < obj_length - 4) - proto_item_append_text(ti, " ..."); - } - break; - - case LMP_CLASS_CHANNEL_STATUS_REQUEST: - for (l=0; l<obj_length - 4; ) { - switch(type) { - case 1: - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_IPV4], - tvb, offset2+l, 4, ENC_BIG_ENDIAN); - l += 4; - break; - - case 2: - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_IPV6], - tvb, offset2+l, 16, ENC_NA); - l += 16; - break; - - case 3: - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_UNNUM], - tvb, offset2+l, 4, ENC_BIG_ENDIAN); - l += 4; - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2+l, obj_length-4-l, ENC_NA); - l = obj_length - 4; - break; - } - } - break; - - case LMP_CLASS_ERROR: - l = tvb_get_ntohl(tvb, offset2); - ti2 = proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[LMPF_VAL_ERROR], - tvb, offset2, 4, l); - - switch(type) { - - case 1: - proto_item_append_text(ti, ": BEGIN_VERIFY_ERROR: %s%s%s%s", - (l&0x01) ? "Unsupported-Link " : "", - (l&0x02) ? "Unwilling" : "", - (l&0x04) ? "Unsupported-Transport" : "", - (l&0x08) ? "TE-Link-ID" : ""); - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_ERROR_FLAGS]); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNSUPPORTED_LINK], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNWILLING], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_TRANSPORT], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_TE_LINK_ID], - tvb, offset, 4, l); - break; - - case 2: - proto_item_append_text(ti, ": LINK_SUMMARY_ERROR: %s%s%s%s%s%s", - (l&0x01) ? "Unacceptable-Params " : "", - (l&0x02) ? "Renegotiate" : "", - (l&0x04) ? "Bad-TE-Link" : "", - (l&0x08) ? "Bad-Data-Link" : "", - (l&0x10) ? "Bad-TE-Link-CType" : "", - (l&0x20) ? "Bad-Data-Link-CType" : ""); - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_ERROR_FLAGS]); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_PARAMETERS], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_RENEGOTIATE], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_TE_LINK], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_DATA_LINK], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_UNKNOWN_TEL_CTYPE], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_UNKNOWN_DL_CTYPE], - tvb, offset, 4, l); - break; - - case 3: - proto_item_append_text(ti, ": TRACE_ERROR: %s%s%s", - (l&0x01) ? "Unsupported Trace Type " : "", - (l&0x02) ? "Invalid Trace Message" : "", - (l&0x10) ? "Unknown Object C-Type" : ""); - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_ERROR_FLAGS]); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_TRACE_UNSUPPORTED_TYPE], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_TRACE_INVALID_MSG], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_TRACE_UNKNOWN_CTYPE], - tvb, offset, 4, l); - break; - - case 4: - proto_item_append_text(ti, ": LAD_ERROR: %s%s%s%s%s", - (l&0x01) ? "Domain Routing Area ID mismatch" : "", - (l&0x02) ? "TCP ID mismatch" : "", - (l&0x04) ? "DA DCN mismatch" : "", - (l&0x08) ? "Capability mismatch" : "", - (l&0x10) ? "Unknown Object C-Type" : ""); - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_ERROR_FLAGS]); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_LAD_AREA_ID_MISMATCH], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_LAD_TCP_ID_MISMATCH], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_LAD_DA_DCN_MISMATCH], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_LAD_CAPABILITY_MISMATCH], - tvb, offset, 4, l); - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_ERROR_LAD_UNKNOWN_CTYPE], - tvb, offset, 4, l); - break; - - default: - proto_item_append_text(ti, ": UNKNOWN_ERROR (%d): 0x%04x", type, l); - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_TRACE: - switch (type) { - case 1: - l = tvb_get_ntohs(tvb, offset2); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_TYPE], - tvb, offset2, 2, l); - proto_item_append_text(lmp_object_tree, ": %s", - val_to_str(l, lmp_trace_type_str, "Unknown (%d)")); - - l = tvb_get_ntohs(tvb, offset2+2); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_LEN], - tvb, offset2+2, 2, l); - if (l && l <= obj_length - 8) { - proto_item_append_text(lmp_object_tree, " = %s", - tvb_format_text(tvb, offset2+4, l)); - proto_tree_add_string(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_MSG], - tvb, offset2+4, l, tvb_format_text(tvb, - offset2+4,l)); - } - else - proto_tree_add_text(lmp_object_tree, tvb, offset2+4, 1, - "[Invalid Trace Length]"); - break; - - case 2: - l = tvb_get_ntohs(tvb, offset2); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_TYPE], - tvb, offset2, 2, l); - proto_item_append_text(lmp_object_tree, ": %s", - val_to_str(l, lmp_trace_type_str, "Unknown (%d)")); - - l = tvb_get_ntohs(tvb, offset2+2); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_LEN], - tvb, offset2+2, 2, l); - proto_item_append_text(lmp_object_tree, " = %s", - tvb_format_text(tvb, offset2+4, l)); - proto_tree_add_string(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_MSG], - tvb, offset2+4, l, tvb_format_text(tvb, offset2+4,l)); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - - } - break; - - case LMP_CLASS_TRACE_REQ: - switch (type) { - case 1: - l = tvb_get_ntohs(tvb, offset2); - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_TRACE_REQ_TYPE], - tvb, offset2, 2, l); - proto_item_append_text(lmp_object_tree, ": %s", - val_to_str(l, lmp_trace_type_str, "Unknown (%d)")); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - - } - break; - - case LMP_CLASS_SERVICE_CONFIG: - - /* Support for the ServiceConfig object defined in the UNI 1.0 spec */ - switch (type) { - - case 1: - /* Supported Signaling Protocols Object */ - - /* Signaling Protocols */ - l = tvb_get_guint8(tvb, offset2); - - ti2 = proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS], - tvb, offset2, 1, l); - proto_item_append_text(ti2, ": %s %s", - (l & 0x01) ? "RSVP-based UNI signaling supported " : "", - (l & 0x02) ? "LDP-based UNI signaling supported " : ""); - - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_SERVICE_CONFIG_SP_FLAGS]); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS_RSVP], - tvb, offset2, 1, l); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS_LDP], - tvb, offset2, 1, l); - - /* UNI version */ - proto_tree_add_text(lmp_object_tree, tvb, offset2+1, 1, - "UNI Version: %u", - tvb_get_guint8(tvb, offset2+1)); - break; - - case 2: - /* Client Port-Level Service Attributes Object */ - - /* Link Type */ - proto_tree_add_text(lmp_object_tree, tvb, offset2, 1, - "Link Type: %s", - val_to_str(tvb_get_guint8(tvb, offset2), - service_attribute_link_type_str, - "UNK (%u). ")); - - proto_item_append_text(lmp_object_tree, "%s", - val_to_str(tvb_get_guint8(tvb, offset2), - service_attribute_link_type_str, - "Unknown (%u). ")); - - l = tvb_get_guint8(tvb, offset2+1); - /* Signal type for SDH */ - if (l == LMP_CLASS_SERVICE_CONFIG_CPSA_SIGNAL_TYPES_SDH) { - /* Signal types for an SDH link */ - proto_tree_add_text(lmp_object_tree, tvb, offset2+1, 1, - "Signal Types: %s", - val_to_str(tvb_get_guint8(tvb, offset2+1), - service_attribute_signal_types_sdh_str, - "Unknown (%u). ")); - - proto_item_append_text(lmp_object_tree, "%s", - val_to_str(tvb_get_guint8(tvb, offset2+1), - service_attribute_signal_types_sdh_str, - "Unknown (%u). ")); - } - - if (l == LMP_CLASS_SERVICE_CONFIG_CPSA_SIGNAL_TYPES_SONET) { - /* Signal types for a SONET link */ - proto_tree_add_text(lmp_object_tree, tvb, offset2+1, 1, - "Signal Types: %s", - val_to_str(tvb_get_guint8(tvb, offset2+1), - service_attribute_signal_types_sonet_str, - "Unknown (%u). ")); - - proto_item_append_text(lmp_object_tree, "%s", - val_to_str(tvb_get_guint8(tvb, offset2+1), - service_attribute_signal_types_sonet_str, - "Unknown (%u). ")); - } - - /* TP Transparency */ - l = tvb_get_guint8(tvb, offset2+2); - ti2 = proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS], - tvb, offset2+2, 1, l); - - proto_item_append_text(ti2, ": %s%s%s", - (l & 0x01) ? "Path/VC Overhead Transparency " : "", - (l & 0x02) ? "Line/MS Overhead Transparency " : "", - (l & 0x04) ? "Section/RS Overhead Transparency " : ""); - - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_SERVICE_CONFIG_CPSA_TP_FLAGS]); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_PATH_OVERHEAD], - tvb, offset2+2, 1, l); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_LINE_OVERHEAD], - tvb, offset2+2, 1, l); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_SECTION_OVERHEAD], - tvb, offset2+2, 1, l); - - /* Contiguous Concatentation Types */ - l = tvb_get_guint8(tvb, offset2+3); - ti2 = proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_CCT_FLAGS], - tvb, offset2+3, 1, l); - - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_SERVICE_CONFIG_CPSA_CCT_FLAGS]); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_CCT_FLAGS_CC_SUPPORTED], - tvb, offset2+3, 1, l); - - /* Min and Max NCC */ - proto_item_append_text(ti, ": Minimum NCC: %d, Maximum NCC: %d", - tvb_get_ntohs(tvb, offset2+4), - tvb_get_ntohs(tvb, offset2+6)); - - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MIN_NCC], - tvb, offset2+4, 2, - tvb_get_ntohs(tvb, offset2+4)); - - proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MAX_NCC], - tvb, offset2+6, 2, - tvb_get_ntohs(tvb, offset2+6)); - - /* Min and Max NVC */ - proto_item_append_text(ti, ": Minimum NVC: %d, Maximum NVC: %d", - tvb_get_ntohs(tvb, offset2+8), - tvb_get_ntohs(tvb, offset2+10)); - - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MIN_NVC], - tvb, offset2+8, 2, ENC_BIG_ENDIAN); - - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MAX_NVC], - tvb, offset2+10, 2, ENC_BIG_ENDIAN); - - /* Local interface ID */ - proto_item_append_text(ti, ": Local Interface ID %s", - tvb_ip_to_str(tvb, offset2+12)); - - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_INTERFACE_ID], - tvb, offset2+12, 4, ENC_BIG_ENDIAN); - - break; - - case 3: - - /* Network Transparency Support and TCM Monitoring Object */ - - /* Transparency */ - l = tvb_get_ntohl(tvb, offset2); - ti2 = proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS], - tvb, offset2, 4, l); - - proto_item_append_text(ti2, ": %s %s", - (l & 0x01) ? "Standard SOH/RSOH transparency supported " : "", - (l & 0x02) ? "Standard LOH/MSOH transparency supported " : ""); - - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS]); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS_SOH], - tvb, offset2, 4, l); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS_LOH], - tvb, offset2, 4, l); - - /* TCM Monitoring */ - l = tvb_get_guint8(tvb, offset2+7); - - ti2 = proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TCM_FLAGS], - tvb, offset2+7, 1, l); - - proto_item_append_text(ti2, ": %s", - (l & 0x01) ? "Transparent Support of TCM available " : ""); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TCM_FLAGS_TCM_SUPPORTED], - tvb, offset2+7, 1, l); - - break; - - case 4: - - /* Network Diversity Object */ - l = tvb_get_guint8(tvb,offset2+3); - - ti2 = proto_tree_add_uint(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS], - tvb, offset2+3, 1, l); - - proto_item_append_text(ti2, ": %s%s%s", - (l & 0x01) ? "Node Diversity is supported " : "", - (l & 0x02) ? "Link Diversity is supported " : "", - (l & 0x04) ? "SRLG Diversity is supported " : ""); - - - lmp_flags_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS]); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_NODE], - tvb, offset2+3, 1, l); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_LINK], - tvb, offset2+3, 1, l); - - proto_tree_add_boolean(lmp_flags_tree, - hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_SRLG], - tvb, offset2+3, 1, l); - break; - - default: - /* Unknown type in Service Config object */ - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - case LMP_CLASS_DA_DCN_ADDRESS: - switch(type) { - - case 1: - proto_item_append_text(ti, ": %s", tvb_ip_to_str(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_LOCAL_DA_DCN_ADDR], tvb, - offset2, 4, ENC_BIG_ENDIAN); - break; - - case 2: - proto_item_append_text(ti, ": %s", tvb_ip_to_str(tvb, offset2)); - proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_REMOTE_DA_DCN_ADDR], tvb, - offset2, 4, ENC_BIG_ENDIAN); - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - - case LMP_CLASS_LOCAL_LAD_INFO: - switch(type) { - case 1: - proto_item_append_text(ti, ": IPv4"); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_NODE_ID], - tvb, offset2, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_AREA_ID], - tvb, offset2+4, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_TE_LINK_ID], - tvb, offset2+8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_COMPONENT_ID], - tvb, offset2+12, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_SC_PC_ID], - tvb, offset2+16, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_SC_PC_ADDR], - tvb, offset2+20, 4, ENC_BIG_ENDIAN); - l = 24; - while (l < obj_length - 4) { - mylen = tvb_get_guint8(tvb, offset2+l+1); - ti2 = proto_tree_add_item(lmp_object_tree, - hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ], - tvb, offset2+l, mylen, ENC_NA); - lmp_subobj_tree = proto_item_add_subtree(ti2, - lmp_subtree[LMP_TREE_LAD_INFO_SUBOBJ]); - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 1, - "Subobject Type: %d", tvb_get_guint8(tvb, offset2+l)); - - if (mylen == 0 || l + mylen > obj_length - 4) { - proto_tree_add_text(lmp_object_tree, tvb, offset2+l+1, 1, - "Subobject Length: %d (Invalid)", mylen); - break; - } - else - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+1, 1, - "Subobject Length: %d", mylen); - - switch(tvb_get_guint8(tvb, offset2+l)) { - - case 250: - proto_item_set_text(ti2, "Primary Routing Controller: " - "Area ID: %s, RC PC ID: %s, " - "RC PC Addr: %s", - tvb_ip_to_str(tvb, offset2+l+4), - tvb_ip_to_str(tvb, offset2+l+8), - tvb_ip_to_str(tvb, offset2+l+12)); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_AREA_ID], - tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_RC_PC_ID], - tvb, offset2+l+8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_RC_PC_ADDR], - tvb, offset2+l+12, 4, ENC_BIG_ENDIAN); - break; - - case 251: - proto_item_set_text(ti2, "Secondary Routing Controller: " - "Area ID: %s, RC PC ID: %s, " - "RC PC Addr: %s", - tvb_ip_to_str(tvb, offset2+l+4), - tvb_ip_to_str(tvb, offset2+l+8), - tvb_ip_to_str(tvb, offset2+l+12)); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_AREA_ID], - tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_RC_PC_ID], - tvb, offset2+l+8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_RC_PC_ADDR], - tvb, offset2+l+12, 4, ENC_BIG_ENDIAN); - break; - - case 252: - proto_item_set_text(ti2, "SONET/SDH Layer Capability: " - "Switching Cap: %s, Encoding Type: %s", - rval_to_str(tvb_get_guint8(tvb, offset2+l+4), - gmpls_switching_type_rvals, "Unknown (%d)"), - rval_to_str(tvb_get_guint8(tvb, offset2+l+5), - gmpls_lsp_enc_rvals, "Unknown (%d)")); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SWITCHING_TYPE], - tvb, offset2+l+4, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(lmp_subobj_tree, - hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_LSP_ENCODING], - tvb, offset2+l+5, 1, ENC_BIG_ENDIAN); - - for (j = 0; j < (mylen - 8) / 4; j++) { - proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+8+(j*4), 4, - "%s: %d free timeslots", - val_to_str_ext(tvb_get_guint8(tvb, offset2+l+8+(j*4)), - &gmpls_sonet_signal_type_str_ext, - "Unknown Signal Type (%d)"), - tvb_get_ntoh24(tvb, offset2+l+9+(j*4))); - } - break; - - default: - proto_tree_add_item(lmp_subobj_tree, hf_lmp_data, tvb, offset2+l, - tvb_get_guint8(tvb, offset2+l+1), ENC_NA); - break; - } - if (tvb_get_guint8(tvb, offset2+l+1) < 1) - THROW(ReportedBoundsError); - l += tvb_get_guint8(tvb, offset2+l+1); - } - - break; - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - break; - - - - default: - proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); - break; - } - - if (obj_length < 1) - THROW(ReportedBoundsError); - offset += obj_length; - len += obj_length; - - } /* while */ + hidden_item = proto_tree_add_boolean(lmp_header_tree, + hf_lmp_filter[lmp_msg_to_filter_num(message_type)], + tvb, offset+3, 1, 1); + PROTO_ITEM_SET_HIDDEN(hidden_item); + } else { + expert_add_info_format(pinfo, msg_item, &ei_lmp_invalid_msg_type, + "Invalid message type: %u", message_type); + return tvb_length(tvb); + } + + if (lmp_checksum_config) { + cksum = tvb_get_ntohs(tvb, offset+6); + ti = proto_tree_add_item(lmp_header_tree, hf_lmp_filter[LMPF_CHECKSUM], tvb, + offset+6, 2, ENC_BIG_ENDIAN); + if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) { + /* The packet isn't part of a fragmented datagram and isn't truncated, so we can checksum it. */ + SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, msg_length); + computed_cksum = in_cksum(cksum_vec, 1); + + if (computed_cksum == 0) { + proto_item_append_text( ti, " [correct]"); + } + else { + expert_add_info_format(pinfo, ti, &ei_lmp_checksum_incorrect, "[incorrect, should be 0x%04x]", + in_cksum_shouldbe(cksum, computed_cksum)); + } + } + } else { + proto_tree_add_text(lmp_header_tree, tvb, offset+6, 2, "No checksum"); + } + + offset += 8; + len = 8; + while (len < msg_length) { + guint8 lmp_class; + guint8 type; + guint8 negotiable; + int filter_num; + const char *object_type; + + obj_length = tvb_get_ntohs(tvb, offset+2); + lmp_class = tvb_get_guint8(tvb, offset+1); + type = tvb_get_guint8(tvb, offset); + negotiable = (type >> 7); type &= 0x7f; + object_type = val_to_str_const(lmp_class, lmp_class_vals, "Unknown"); + hidden_item = proto_tree_add_uint(lmp_tree, hf_lmp_filter[LMPF_OBJECT], tvb, + offset, 1, lmp_class); + PROTO_ITEM_SET_GENERATED(hidden_item); + filter_num = lmp_class_to_filter_num(lmp_class); + if (filter_num != -1 && lmp_valid_class(lmp_class)) { + ti = proto_tree_add_item(lmp_tree, + hf_lmp_filter[filter_num], + tvb, offset, obj_length, ENC_NA); /* all possibilities are FT_NONE */ + } else { + expert_add_info_format(pinfo, hidden_item, &ei_lmp_invalid_class, + "Invalid class: %u", lmp_class); + return tvb_length(tvb); + } + lmp_object_tree = proto_item_add_subtree(ti, lmp_class_to_subtree(lmp_class)); + + lmp_object_header_tree = proto_tree_add_subtree_format(lmp_object_tree, tvb, offset, 4, + lmp_subtree[LMP_TREE_OBJECT_HEADER], &ti2, + "Header. Class %d, C-Type %d, Length %d, %s", + lmp_class, type, obj_length, + negotiable ? "Negotiable" : "Not Negotiable"); + + proto_tree_add_text(lmp_object_header_tree, tvb, offset, 1, + negotiable ? "Negotiable" : "Not Negotiable"); + proto_tree_add_text(lmp_object_header_tree, tvb, offset+2, 2, + "Length: %u", obj_length); + proto_tree_add_text(lmp_object_header_tree, tvb, offset+1, 1, + "Object Class: %u - %s", + lmp_class, object_type); + proto_tree_add_uint(lmp_object_header_tree, hf_lmp_filter[LMPF_VAL_CTYPE], + tvb, offset, 1, type); + offset2 = offset+4; + mylen = obj_length - 4; + + switch (lmp_class) { + + case LMP_CLASS_NULL: + break; + + case LMP_CLASS_CCID: + switch(type) { + + case 1: + l = LMPF_VAL_LOCAL_CCID; + proto_item_append_text(ti, ": %d", tvb_get_ntohl(tvb, offset2)); + proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, tvb_get_ntohl(tvb, offset2)); + break; + + case 2: + l = LMPF_VAL_REMOTE_CCID; + proto_item_append_text(ti, ": %d", tvb_get_ntohl(tvb, offset2)); + proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, tvb_get_ntohl(tvb, offset2)); + break; + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_NODE_ID: + switch(type) { + + case 1: + l = LMPF_VAL_LOCAL_NODE_ID; + proto_item_append_text(ti, ": %s", tvb_ip_to_str(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, ENC_BIG_ENDIAN); + break; + + case 2: + l = LMPF_VAL_REMOTE_NODE_ID; + proto_item_append_text(ti, ": %s", tvb_ip_to_str(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, ENC_BIG_ENDIAN); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_LINK_ID: + + switch(type) { + + case 1: + case 2: + l = (type == 1)? LMPF_VAL_LOCAL_LINK_ID_IPV4: + LMPF_VAL_REMOTE_LINK_ID_IPV4; + proto_item_append_text(ti, ": IPv4 %s", tvb_ip_to_str(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, ENC_BIG_ENDIAN); + break; + + case 3: + case 4: + l = (type == 3)? LMPF_VAL_LOCAL_LINK_ID_IPV6: + LMPF_VAL_REMOTE_LINK_ID_IPV6; + proto_item_append_text(ti, ": IPv6 %s", tvb_ip6_to_str(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 16, ENC_NA); + break; + case 5: + case 6: + l = (type == 5)? LMPF_VAL_LOCAL_LINK_ID_UNNUM: + LMPF_VAL_REMOTE_LINK_ID_UNNUM; + proto_item_append_text(ti, ": Unnumbered %d", + tvb_get_ntohl(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, ENC_BIG_ENDIAN); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_INTERFACE_ID: + + switch(type) { + + case 1: + case 2: + l = (type == 1)? LMPF_VAL_LOCAL_INTERFACE_ID_IPV4: + LMPF_VAL_REMOTE_INTERFACE_ID_IPV4; + proto_item_append_text(ti, ": IPv4 %s", tvb_ip_to_str(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, ENC_BIG_ENDIAN); + break; + + case 3: + case 4: + l = (type == 3)? LMPF_VAL_LOCAL_INTERFACE_ID_IPV6: + LMPF_VAL_REMOTE_INTERFACE_ID_IPV6; + proto_item_append_text(ti, ": IPv6 %s", tvb_ip6_to_str(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 16, ENC_NA); + break; + + case 5: + case 6: + l = (type == 5)? LMPF_VAL_LOCAL_INTERFACE_ID_UNNUM: + LMPF_VAL_REMOTE_INTERFACE_ID_UNNUM; + proto_item_append_text(ti, ": Unnumbered %d", + tvb_get_ntohl(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, ENC_BIG_ENDIAN); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_MESSAGE_ID: + + switch(type) { + + case 1: + + l = LMPF_VAL_MESSAGE_ID; + proto_item_append_text(ti, ": %d", tvb_get_ntohl(tvb, offset2)); + proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, tvb_get_ntohl(tvb, offset2)); + break; + + case 2: + l = LMPF_VAL_MESSAGE_ID_ACK; + proto_item_append_text(ti, ": %d", tvb_get_ntohl(tvb, offset2)); + proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[l], tvb, + offset2, 4, tvb_get_ntohl(tvb, offset2)); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_CONFIG: + + switch(type) { + + case 1: + proto_item_append_text(ti, ": HelloInterval: %d, HelloDeadInterval: %d", + tvb_get_ntohs(tvb, offset2), + tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_CONFIG_HELLO], + tvb, offset2, 2, tvb_get_ntohs(tvb, offset2)); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_CONFIG_HELLO_DEAD], + tvb, offset2+2, 2, + tvb_get_ntohs(tvb, offset2+2)); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_HELLO: + + switch(type) { + + case 1: + proto_item_append_text(ti, ": TxSeq %d, RxSeq: %d", + tvb_get_ntohl(tvb, offset2), + tvb_get_ntohl(tvb, offset2+4)); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_HELLO_TXSEQ], + tvb, offset2, 4, + tvb_get_ntohl(tvb, offset2)); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_HELLO_RXSEQ], + tvb, offset2+4, 4, + tvb_get_ntohl(tvb, offset2+4)); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_BEGIN_VERIFY: + + switch(type) { + + case 1: + l = tvb_get_ntohs(tvb, offset2); + ti2 = proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS], + tvb, offset2, 2, ENC_BIG_ENDIAN); + + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_BEGIN_VERIFY_FLAGS]); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS_ALL_LINKS], + tvb, offset2, 2, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS_LINK_TYPE], + tvb, offset2, 2, l); + proto_tree_add_text(lmp_object_tree, tvb, offset2+2, 2, + "Verify Interval: %d ms", + tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(lmp_object_tree, tvb, offset2+4, 4, + "Number of Data Links: %d", + tvb_get_ntohl(tvb, offset2+4)); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_ENCTYPE], + tvb, offset2+8, 1, ENC_BIG_ENDIAN); + proto_tree_add_text(lmp_object_tree, tvb, offset2+10, 2, + "Verify Transport Mechanism: 0x%0x", + tvb_get_ntohs(tvb, offset2+10)); + proto_tree_add_text(lmp_object_tree, tvb, offset2+12, 4, + "Transmission Rate: %.3f Mbps", + tvb_get_ntohieee_float(tvb, offset2+12)*8/1000000); + proto_tree_add_text(lmp_object_tree, tvb, offset2+16, 4, + "Wavelength: %d", + tvb_get_ntohl(tvb, offset2+16)); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_BEGIN_VERIFY_ACK: + + switch(type) { + + case 1: + proto_item_append_text(ti, ": VerifyDeadInterval: %d, TransportResponse: 0x%0x", + tvb_get_ntohs(tvb, offset2), + tvb_get_ntohs(tvb, offset2+2)); + proto_tree_add_text(lmp_object_tree, tvb, offset2, 2, + "VerifyDeadInterval: %d ms", + tvb_get_ntohs(tvb, offset2)); + proto_tree_add_text(lmp_object_tree, tvb, offset2+2, 2, + "Verify Transport Response: 0x%0x", + tvb_get_ntohs(tvb, offset2+2)); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_VERIFY_ID: + + switch(type) { + + case 1: + proto_item_append_text(ti, ": %d", + tvb_get_ntohl(tvb, offset2)); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_VERIFY_ID], + tvb, offset2, 4, + tvb_get_ntohl(tvb, offset2)); + break; + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_TE_LINK: + l = tvb_get_guint8(tvb, offset2); + ti2 = proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS], + tvb, offset2, 1, l); + + proto_item_append_text(ti2, ": %s%s", + (l&0x01) ? "Fault-Mgmt-Supported " : "", + (l&0x02) ? "Link-Verification-Supported " : ""); + + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_TE_LINK_FLAGS]); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS_FAULT_MGMT], + tvb, offset2, 1, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS_LINK_VERIFY], + tvb, offset2, 1, l); + switch(type) { + + case 1: + proto_item_append_text(ti, ": IPv4: Local %s, Remote %s", + tvb_ip_to_str(tvb, offset2+4), + tvb_ip_to_str(tvb, offset2+8)); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_IPV4], + tvb, offset2+4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_IPV4], + tvb, offset2+8, 4, ENC_BIG_ENDIAN); + break; + + case 2: + proto_item_append_text(ti, ": IPv6: Local %s, Remote %s", + tvb_ip6_to_str(tvb, offset2+4), + tvb_ip6_to_str(tvb, offset2+20)); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_IPV6], + tvb, offset2+4, 16, ENC_NA); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_IPV6], + tvb, offset2+20, 16, ENC_NA); + break; + + case 3: + proto_item_append_text(ti, ": Unnumbered: Local %d, Remote %d", + tvb_get_ntohl(tvb, offset2+4), + tvb_get_ntohl(tvb, offset2+8)); + + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_UNNUM], + tvb, offset2+4, 4, ENC_BIG_ENDIAN); + + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_UNNUM], + tvb, offset2+8, 4, ENC_BIG_ENDIAN); + break; + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_DATA_LINK: + + l = tvb_get_guint8(tvb, offset2); + ti2 = proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS], + tvb, offset2, 1, l); + proto_item_append_text(ti2, ": %s%s", + (l&0x01) ? "Interface-Type-Port " : "Interface-Type-Component-Link ", + (l&0x02) ? "Allocated " : "Unallocated "); + + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_DATA_LINK_FLAGS]); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS_PORT], + tvb, offset2, 1, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS_ALLOCATED], + tvb, offset2, 1, l); + switch(type) { + + case 1: + proto_item_append_text(ti, ": IPv4: Local %s, Remote %s", + tvb_ip_to_str(tvb, offset2+4), + tvb_ip_to_str(tvb, offset2+8)); + + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_DATA_LINK_LOCAL_IPV4], + tvb, offset2+4, 4, ENC_BIG_ENDIAN); + + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_DATA_LINK_REMOTE_IPV4], + tvb, offset2+8, 4, ENC_BIG_ENDIAN); + l = 12; + break; + + case 2: + proto_item_append_text(ti, ": IPv6: Local %s, Remote %s", + tvb_ip6_to_str(tvb, offset2+4), + tvb_ip6_to_str(tvb, offset2+8)); + proto_tree_add_text(lmp_object_tree, tvb, offset2+4, 16, + "Data-Link Local ID - IPv6: %s", + tvb_ip6_to_str(tvb, offset2)); + proto_tree_add_text(lmp_object_tree, tvb, offset2+20,16, + "Data-Link Remote ID - IPv6: %s", + tvb_ip6_to_str(tvb, offset2+4)); + l = 36; + break; + + case 3: + proto_item_append_text(ti, ": Unnumbered: Local %d, Remote %d", + tvb_get_ntohl(tvb, offset2+4), + tvb_get_ntohl(tvb, offset2+8)); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_DATA_LINK_LOCAL_UNNUM], + tvb, offset2+4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_DATA_LINK_REMOTE_UNNUM], + tvb, offset2+8, 4, ENC_BIG_ENDIAN); + l = 12; + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + + while (l < obj_length - 4) { + mylen = tvb_get_guint8(tvb, offset2+l+1); + ti2 = proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ], + tvb, offset2+l, mylen, ENC_NA); + lmp_subobj_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_DATA_LINK_SUBOBJ]); + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 1, + "Subobject Type: %d", + tvb_get_guint8(tvb, offset2+l)); + + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+1, 1, + "Subobject Length: %d", mylen); + switch(tvb_get_guint8(tvb, offset2+l)) { + + case 1: + + proto_item_set_text(ti2, "Interface Switching Capability: " + "Switching Cap: %s, Encoding Type: %s, " + "Min BW: %.3f Mbps, Max BW: %.3f Mbps", + rval_to_str(tvb_get_guint8(tvb, offset2+l+2), + gmpls_switching_type_rvals, "Unknown (%d)"), + rval_to_str(tvb_get_guint8(tvb, offset2+l+3), + gmpls_lsp_enc_rvals, "Unknown (%d)"), + tvb_get_ntohieee_float(tvb, offset2+l+4)*8/1000000, + tvb_get_ntohieee_float(tvb, offset2+l+8)*8/1000000); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ_SWITCHING_TYPE], + tvb, offset2+l+2, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ_LSP_ENCODING], + tvb, offset2+l+3, 1, ENC_BIG_ENDIAN); + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+4, 4, + "Minimum Reservable Bandwidth: %.3f Mbps", + tvb_get_ntohieee_float(tvb, offset2+l+4)*8/1000000); + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+8, 4, + "Maximum Reservable Bandwidth: %.3f Mbps", + tvb_get_ntohieee_float(tvb, offset2+l+8)*8/1000000); + break; + + case 2: + proto_item_set_text(ti2, "Wavelength: %d", + tvb_get_ntohl(tvb, offset2+l+2)); + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+4, 4, + "Wavelength: %d", + tvb_get_ntohl(tvb, offset2+l+4)); + break; + + default: + proto_tree_add_item(lmp_subobj_tree, hf_lmp_data, tvb, offset2+l, + tvb_get_guint8(tvb, offset2+l+1), ENC_NA); + break; + } + if (tvb_get_guint8(tvb, offset2+l+1) < 1) + THROW(ReportedBoundsError); + l += tvb_get_guint8(tvb, offset2+l+1); + } + + break; + + case LMP_CLASS_CHANNEL_STATUS: + + k = 0; j = 0; + + switch(type) { + + case 1: + case 3: + k = 8; break; + + case 2: + k = 20; break; + } + + if (!k) + break; + + for (l=0; l<obj_length - 4; ) { + + lmp_subobj_tree = proto_tree_add_subtree(lmp_object_tree, tvb, offset2+l, k, + lmp_subtree[LMP_TREE_CHANNEL_STATUS_ID], &ti2, "Interface-Id"); + switch(type) { + + case 1: + if (j < 4) + proto_item_append_text(ti, ": [IPv4-%s", + tvb_ip_to_str(tvb, offset2+l)); + proto_item_append_text(ti2, ": IPv4 %s", + tvb_ip_to_str(tvb, offset2+l)); + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 4, + "Interface ID: IPv4: %s", + tvb_ip_to_str(tvb, offset2+l)); + l += 4; + break; + + case 2: + if (j < 4) + proto_item_append_text(ti, ": [IPv6-%s", tvb_ip6_to_str(tvb, offset2+l)); + proto_item_append_text(ti2, ": IPv6 %s", tvb_ip6_to_str(tvb, offset2+l)); + proto_tree_add_text(lmp_subobj_tree, tvb, offset2, 16, "Interface ID: IPv6: %s", + tvb_ip6_to_str(tvb, offset2+l)); + l += 16; + break; + + case 3: + if (j < 4) + proto_item_append_text(ti, ": [Unnum-%d", + tvb_get_ntohl(tvb, offset2+l)); + proto_item_append_text(ti, ": Unnumbered %d", + tvb_get_ntohl(tvb, offset2+l)); + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 4, + "Interface ID: Unnumbered: %d", + tvb_get_ntohl(tvb, offset2+l)); + l += 4; + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2+l, obj_length-4-l, ENC_NA); + break; + } + if (l == obj_length - 4) break; + + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 1, + tvb_get_guint8(tvb, offset2+l) & 0x80 ? + "Link Allocated - Active Monitoring" : + "Link Not Allocated"); + if (j < 4) + proto_item_append_text(ti, "-%s,%s], ", + tvb_get_guint8(tvb, offset2+l) & 0x80 ? "Act" : "NA", + val_to_str(tvb_get_ntohl(tvb, offset2+l) & 0x7fffffff, + channel_status_short_str, "UNK (%u).")); + proto_item_append_text(ti2, ": %s, ", + tvb_get_guint8(tvb, offset2+l) & 0x80 ? "Active" : "Not Active"); + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 4, + "Channel Status: %s", + val_to_str(tvb_get_ntohl(tvb, offset2+l) & 0x7fffffff, + channel_status_str, "Unknown (%u). ")); + proto_item_append_text(ti2, "%s", val_to_str(tvb_get_ntohl(tvb, offset2+l) & 0x7fffffff, + channel_status_str, "Unknown (%u). ")); + j++; + l += 4; + if (j==4 && l < obj_length - 4) + proto_item_append_text(ti, " ..."); + } + break; + + case LMP_CLASS_CHANNEL_STATUS_REQUEST: + for (l=0; l<obj_length - 4; ) { + switch(type) { + case 1: + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_IPV4], + tvb, offset2+l, 4, ENC_BIG_ENDIAN); + l += 4; + break; + + case 2: + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_IPV6], + tvb, offset2+l, 16, ENC_NA); + l += 16; + break; + + case 3: + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_UNNUM], + tvb, offset2+l, 4, ENC_BIG_ENDIAN); + l += 4; + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2+l, obj_length-4-l, ENC_NA); + l = obj_length - 4; + break; + } + } + break; + + case LMP_CLASS_ERROR: + l = tvb_get_ntohl(tvb, offset2); + ti2 = proto_tree_add_uint(lmp_object_tree, hf_lmp_filter[LMPF_VAL_ERROR], + tvb, offset2, 4, l); + + switch(type) { + + case 1: + proto_item_append_text(ti, ": BEGIN_VERIFY_ERROR: %s%s%s%s", + (l&0x01) ? "Unsupported-Link " : "", + (l&0x02) ? "Unwilling" : "", + (l&0x04) ? "Unsupported-Transport" : "", + (l&0x08) ? "TE-Link-ID" : ""); + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_ERROR_FLAGS]); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNSUPPORTED_LINK], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNWILLING], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_TRANSPORT], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_TE_LINK_ID], + tvb, offset, 4, l); + break; + + case 2: + proto_item_append_text(ti, ": LINK_SUMMARY_ERROR: %s%s%s%s%s%s", + (l&0x01) ? "Unacceptable-Params " : "", + (l&0x02) ? "Renegotiate" : "", + (l&0x04) ? "Bad-TE-Link" : "", + (l&0x08) ? "Bad-Data-Link" : "", + (l&0x10) ? "Bad-TE-Link-CType" : "", + (l&0x20) ? "Bad-Data-Link-CType" : ""); + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_ERROR_FLAGS]); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_PARAMETERS], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_RENEGOTIATE], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_TE_LINK], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_DATA_LINK], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_UNKNOWN_TEL_CTYPE], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_UNKNOWN_DL_CTYPE], + tvb, offset, 4, l); + break; + + case 3: + proto_item_append_text(ti, ": TRACE_ERROR: %s%s%s", + (l&0x01) ? "Unsupported Trace Type " : "", + (l&0x02) ? "Invalid Trace Message" : "", + (l&0x10) ? "Unknown Object C-Type" : ""); + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_ERROR_FLAGS]); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_TRACE_UNSUPPORTED_TYPE], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_TRACE_INVALID_MSG], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_TRACE_UNKNOWN_CTYPE], + tvb, offset, 4, l); + break; + + case 4: + proto_item_append_text(ti, ": LAD_ERROR: %s%s%s%s%s", + (l&0x01) ? "Domain Routing Area ID mismatch" : "", + (l&0x02) ? "TCP ID mismatch" : "", + (l&0x04) ? "DA DCN mismatch" : "", + (l&0x08) ? "Capability mismatch" : "", + (l&0x10) ? "Unknown Object C-Type" : ""); + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_ERROR_FLAGS]); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_LAD_AREA_ID_MISMATCH], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_LAD_TCP_ID_MISMATCH], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_LAD_DA_DCN_MISMATCH], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_LAD_CAPABILITY_MISMATCH], + tvb, offset, 4, l); + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_ERROR_LAD_UNKNOWN_CTYPE], + tvb, offset, 4, l); + break; + + default: + proto_item_append_text(ti, ": UNKNOWN_ERROR (%d): 0x%04x", type, l); + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_TRACE: + switch (type) { + case 1: + l = tvb_get_ntohs(tvb, offset2); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_TYPE], + tvb, offset2, 2, l); + proto_item_append_text(lmp_object_tree, ": %s", + val_to_str(l, lmp_trace_type_str, "Unknown (%d)")); + + l = tvb_get_ntohs(tvb, offset2+2); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_LEN], + tvb, offset2+2, 2, l); + if (l && l <= obj_length - 8) { + proto_item_append_text(lmp_object_tree, " = %s", + tvb_format_text(tvb, offset2+4, l)); + proto_tree_add_string(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_MSG], + tvb, offset2+4, l, tvb_format_text(tvb, + offset2+4,l)); + } + else + proto_tree_add_text(lmp_object_tree, tvb, offset2+4, 1, + "[Invalid Trace Length]"); + break; + + case 2: + l = tvb_get_ntohs(tvb, offset2); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_TYPE], + tvb, offset2, 2, l); + proto_item_append_text(lmp_object_tree, ": %s", + val_to_str(l, lmp_trace_type_str, "Unknown (%d)")); + + l = tvb_get_ntohs(tvb, offset2+2); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_LEN], + tvb, offset2+2, 2, l); + proto_item_append_text(lmp_object_tree, " = %s", + tvb_format_text(tvb, offset2+4, l)); + proto_tree_add_string(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_MSG], + tvb, offset2+4, l, tvb_format_text(tvb, offset2+4,l)); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + + } + break; + + case LMP_CLASS_TRACE_REQ: + switch (type) { + case 1: + l = tvb_get_ntohs(tvb, offset2); + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_TRACE_REQ_TYPE], + tvb, offset2, 2, l); + proto_item_append_text(lmp_object_tree, ": %s", + val_to_str(l, lmp_trace_type_str, "Unknown (%d)")); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + + } + break; + + case LMP_CLASS_SERVICE_CONFIG: + + /* Support for the ServiceConfig object defined in the UNI 1.0 spec */ + switch (type) { + + case 1: + /* Supported Signaling Protocols Object */ + + /* Signaling Protocols */ + l = tvb_get_guint8(tvb, offset2); + + ti2 = proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS], + tvb, offset2, 1, l); + proto_item_append_text(ti2, ": %s %s", + (l & 0x01) ? "RSVP-based UNI signaling supported " : "", + (l & 0x02) ? "LDP-based UNI signaling supported " : ""); + + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_SERVICE_CONFIG_SP_FLAGS]); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS_RSVP], + tvb, offset2, 1, l); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS_LDP], + tvb, offset2, 1, l); + + /* UNI version */ + proto_tree_add_text(lmp_object_tree, tvb, offset2+1, 1, + "UNI Version: %u", + tvb_get_guint8(tvb, offset2+1)); + break; + + case 2: + /* Client Port-Level Service Attributes Object */ + + /* Link Type */ + proto_tree_add_text(lmp_object_tree, tvb, offset2, 1, + "Link Type: %s", + val_to_str(tvb_get_guint8(tvb, offset2), + service_attribute_link_type_str, + "UNK (%u). ")); + + proto_item_append_text(lmp_object_tree, "%s", + val_to_str(tvb_get_guint8(tvb, offset2), + service_attribute_link_type_str, + "Unknown (%u). ")); + + l = tvb_get_guint8(tvb, offset2+1); + /* Signal type for SDH */ + if (l == LMP_CLASS_SERVICE_CONFIG_CPSA_SIGNAL_TYPES_SDH) { + /* Signal types for an SDH link */ + proto_tree_add_text(lmp_object_tree, tvb, offset2+1, 1, + "Signal Types: %s", + val_to_str(tvb_get_guint8(tvb, offset2+1), + service_attribute_signal_types_sdh_str, + "Unknown (%u). ")); + + proto_item_append_text(lmp_object_tree, "%s", + val_to_str(tvb_get_guint8(tvb, offset2+1), + service_attribute_signal_types_sdh_str, + "Unknown (%u). ")); + } + + if (l == LMP_CLASS_SERVICE_CONFIG_CPSA_SIGNAL_TYPES_SONET) { + /* Signal types for a SONET link */ + proto_tree_add_text(lmp_object_tree, tvb, offset2+1, 1, + "Signal Types: %s", + val_to_str(tvb_get_guint8(tvb, offset2+1), + service_attribute_signal_types_sonet_str, + "Unknown (%u). ")); + + proto_item_append_text(lmp_object_tree, "%s", + val_to_str(tvb_get_guint8(tvb, offset2+1), + service_attribute_signal_types_sonet_str, + "Unknown (%u). ")); + } + + /* TP Transparency */ + l = tvb_get_guint8(tvb, offset2+2); + ti2 = proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS], + tvb, offset2+2, 1, l); + + proto_item_append_text(ti2, ": %s%s%s", + (l & 0x01) ? "Path/VC Overhead Transparency " : "", + (l & 0x02) ? "Line/MS Overhead Transparency " : "", + (l & 0x04) ? "Section/RS Overhead Transparency " : ""); + + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_SERVICE_CONFIG_CPSA_TP_FLAGS]); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_PATH_OVERHEAD], + tvb, offset2+2, 1, l); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_LINE_OVERHEAD], + tvb, offset2+2, 1, l); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_SECTION_OVERHEAD], + tvb, offset2+2, 1, l); + + /* Contiguous Concatentation Types */ + l = tvb_get_guint8(tvb, offset2+3); + ti2 = proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_CCT_FLAGS], + tvb, offset2+3, 1, l); + + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_SERVICE_CONFIG_CPSA_CCT_FLAGS]); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_CCT_FLAGS_CC_SUPPORTED], + tvb, offset2+3, 1, l); + + /* Min and Max NCC */ + proto_item_append_text(ti, ": Minimum NCC: %d, Maximum NCC: %d", + tvb_get_ntohs(tvb, offset2+4), + tvb_get_ntohs(tvb, offset2+6)); + + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MIN_NCC], + tvb, offset2+4, 2, + tvb_get_ntohs(tvb, offset2+4)); + + proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MAX_NCC], + tvb, offset2+6, 2, + tvb_get_ntohs(tvb, offset2+6)); + + /* Min and Max NVC */ + proto_item_append_text(ti, ": Minimum NVC: %d, Maximum NVC: %d", + tvb_get_ntohs(tvb, offset2+8), + tvb_get_ntohs(tvb, offset2+10)); + + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MIN_NVC], + tvb, offset2+8, 2, ENC_BIG_ENDIAN); + + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MAX_NVC], + tvb, offset2+10, 2, ENC_BIG_ENDIAN); + + /* Local interface ID */ + proto_item_append_text(ti, ": Local Interface ID %s", + tvb_ip_to_str(tvb, offset2+12)); + + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_INTERFACE_ID], + tvb, offset2+12, 4, ENC_BIG_ENDIAN); + + break; + + case 3: + + /* Network Transparency Support and TCM Monitoring Object */ + + /* Transparency */ + l = tvb_get_ntohl(tvb, offset2); + ti2 = proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS], + tvb, offset2, 4, l); + + proto_item_append_text(ti2, ": %s %s", + (l & 0x01) ? "Standard SOH/RSOH transparency supported " : "", + (l & 0x02) ? "Standard LOH/MSOH transparency supported " : ""); + + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS]); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS_SOH], + tvb, offset2, 4, l); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS_LOH], + tvb, offset2, 4, l); + + /* TCM Monitoring */ + l = tvb_get_guint8(tvb, offset2+7); + + ti2 = proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TCM_FLAGS], + tvb, offset2+7, 1, l); + + proto_item_append_text(ti2, ": %s", + (l & 0x01) ? "Transparent Support of TCM available " : ""); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TCM_FLAGS_TCM_SUPPORTED], + tvb, offset2+7, 1, l); + + break; + + case 4: + + /* Network Diversity Object */ + l = tvb_get_guint8(tvb,offset2+3); + + ti2 = proto_tree_add_uint(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS], + tvb, offset2+3, 1, l); + + proto_item_append_text(ti2, ": %s%s%s", + (l & 0x01) ? "Node Diversity is supported " : "", + (l & 0x02) ? "Link Diversity is supported " : "", + (l & 0x04) ? "SRLG Diversity is supported " : ""); + + + lmp_flags_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS]); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_NODE], + tvb, offset2+3, 1, l); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_LINK], + tvb, offset2+3, 1, l); + + proto_tree_add_boolean(lmp_flags_tree, + hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_SRLG], + tvb, offset2+3, 1, l); + break; + + default: + /* Unknown type in Service Config object */ + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + case LMP_CLASS_DA_DCN_ADDRESS: + switch(type) { + + case 1: + proto_item_append_text(ti, ": %s", tvb_ip_to_str(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_LOCAL_DA_DCN_ADDR], tvb, + offset2, 4, ENC_BIG_ENDIAN); + break; + + case 2: + proto_item_append_text(ti, ": %s", tvb_ip_to_str(tvb, offset2)); + proto_tree_add_item(lmp_object_tree, hf_lmp_filter[LMPF_VAL_REMOTE_DA_DCN_ADDR], tvb, + offset2, 4, ENC_BIG_ENDIAN); + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + + case LMP_CLASS_LOCAL_LAD_INFO: + switch(type) { + case 1: + proto_item_append_text(ti, ": IPv4"); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_NODE_ID], + tvb, offset2, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_AREA_ID], + tvb, offset2+4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_TE_LINK_ID], + tvb, offset2+8, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_COMPONENT_ID], + tvb, offset2+12, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_SC_PC_ID], + tvb, offset2+16, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_SC_PC_ADDR], + tvb, offset2+20, 4, ENC_BIG_ENDIAN); + l = 24; + while (l < obj_length - 4) { + mylen = tvb_get_guint8(tvb, offset2+l+1); + ti2 = proto_tree_add_item(lmp_object_tree, + hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ], + tvb, offset2+l, mylen, ENC_NA); + lmp_subobj_tree = proto_item_add_subtree(ti2, + lmp_subtree[LMP_TREE_LAD_INFO_SUBOBJ]); + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l, 1, + "Subobject Type: %d", tvb_get_guint8(tvb, offset2+l)); + + if (mylen == 0 || l + mylen > obj_length - 4) { + proto_tree_add_text(lmp_object_tree, tvb, offset2+l+1, 1, + "Subobject Length: %d (Invalid)", mylen); + break; + } + else + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+1, 1, + "Subobject Length: %d", mylen); + + switch(tvb_get_guint8(tvb, offset2+l)) { + + case 250: + proto_item_set_text(ti2, "Primary Routing Controller: " + "Area ID: %s, RC PC ID: %s, " + "RC PC Addr: %s", + tvb_ip_to_str(tvb, offset2+l+4), + tvb_ip_to_str(tvb, offset2+l+8), + tvb_ip_to_str(tvb, offset2+l+12)); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_AREA_ID], + tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_RC_PC_ID], + tvb, offset2+l+8, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_RC_PC_ADDR], + tvb, offset2+l+12, 4, ENC_BIG_ENDIAN); + break; + + case 251: + proto_item_set_text(ti2, "Secondary Routing Controller: " + "Area ID: %s, RC PC ID: %s, " + "RC PC Addr: %s", + tvb_ip_to_str(tvb, offset2+l+4), + tvb_ip_to_str(tvb, offset2+l+8), + tvb_ip_to_str(tvb, offset2+l+12)); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_AREA_ID], + tvb, offset2+l+4, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_RC_PC_ID], + tvb, offset2+l+8, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_RC_PC_ADDR], + tvb, offset2+l+12, 4, ENC_BIG_ENDIAN); + break; + + case 252: + proto_item_set_text(ti2, "SONET/SDH Layer Capability: " + "Switching Cap: %s, Encoding Type: %s", + rval_to_str(tvb_get_guint8(tvb, offset2+l+4), + gmpls_switching_type_rvals, "Unknown (%d)"), + rval_to_str(tvb_get_guint8(tvb, offset2+l+5), + gmpls_lsp_enc_rvals, "Unknown (%d)")); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SWITCHING_TYPE], + tvb, offset2+l+4, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(lmp_subobj_tree, + hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_LSP_ENCODING], + tvb, offset2+l+5, 1, ENC_BIG_ENDIAN); + + for (j = 0; j < (mylen - 8) / 4; j++) { + proto_tree_add_text(lmp_subobj_tree, tvb, offset2+l+8+(j*4), 4, + "%s: %d free timeslots", + val_to_str_ext(tvb_get_guint8(tvb, offset2+l+8+(j*4)), + &gmpls_sonet_signal_type_str_ext, + "Unknown Signal Type (%d)"), + tvb_get_ntoh24(tvb, offset2+l+9+(j*4))); + } + break; + + default: + proto_tree_add_item(lmp_subobj_tree, hf_lmp_data, tvb, offset2+l, + tvb_get_guint8(tvb, offset2+l+1), ENC_NA); + break; + } + if (tvb_get_guint8(tvb, offset2+l+1) < 1) + THROW(ReportedBoundsError); + l += tvb_get_guint8(tvb, offset2+l+1); + } + + break; + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + break; + + + + default: + proto_tree_add_item(lmp_object_tree, hf_lmp_data, tvb, offset2, mylen, ENC_NA); + break; + } + + if (obj_length < 1) + THROW(ReportedBoundsError); + offset += obj_length; + len += obj_length; + + } /* while */ } /* tree */ return tvb_length(tvb); @@ -1969,9 +1969,9 @@ static void lmp_prefs_applied (void) { if (lmp_udp_port != lmp_udp_port_config) { - dissector_delete_uint("udp.port", lmp_udp_port, lmp_handle); - lmp_udp_port = lmp_udp_port_config; - dissector_add_uint("udp.port", lmp_udp_port, lmp_handle); + dissector_delete_uint("udp.port", lmp_udp_port, lmp_handle); + lmp_udp_port = lmp_udp_port_config; + dissector_add_uint("udp.port", lmp_udp_port, lmp_handle); } } @@ -1983,11 +1983,11 @@ register_lmp_prefs (void) lmp_module = prefs_register_protocol(proto_lmp, lmp_prefs_applied); prefs_register_uint_preference( - lmp_module, "udp_port", "LMP UDP Port", - "UDP port number to use for LMP", 10, &lmp_udp_port_config); + lmp_module, "udp_port", "LMP UDP Port", + "UDP port number to use for LMP", 10, &lmp_udp_port_config); prefs_register_bool_preference( - lmp_module, "checksum", "LMP checksum field", - "Whether LMP contains a checksum which can be checked", &lmp_checksum_config); + lmp_module, "checksum", "LMP checksum field", + "Whether LMP contains a checksum which can be checked", &lmp_checksum_config); prefs_register_obsolete_preference( lmp_module, "version"); } @@ -1998,683 +1998,683 @@ proto_register_lmp(void) static gint *ett[NUM_LMP_SUBTREES]; int i; - static hf_register_info lmpf_info[] = { + static hf_register_info lmpf_info[] = { - /* Message type number */ - {&hf_lmp_filter[LMPF_MSG], - { "Message Type", "lmp.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0, - NULL, HFILL }}, + /* Message type number */ + {&hf_lmp_filter[LMPF_MSG], + { "Message Type", "lmp.msg", FT_UINT8, BASE_DEC, VALS(message_type_vals), 0x0, + NULL, HFILL }}, - /* Message type shorthands */ - {&hf_lmp_filter[LMPF_MSG_CONFIG], - { "Config Message", "lmp.msg.config", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + /* Message type shorthands */ + {&hf_lmp_filter[LMPF_MSG_CONFIG], + { "Config Message", "lmp.msg.config", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_CONFIG_ACK], - { "ConfigAck Message", "lmp.msg.configack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_CONFIG_ACK], + { "ConfigAck Message", "lmp.msg.configack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_CONFIG_NACK], - { "ConfigNack Message", "lmp.msg.confignack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_CONFIG_NACK], + { "ConfigNack Message", "lmp.msg.confignack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_HELLO], - { "HELLO Message", "lmp.msg.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_HELLO], + { "HELLO Message", "lmp.msg.hello", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_BEGIN_VERIFY], - { "BeginVerify Message", "lmp.msg.beginverify", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_BEGIN_VERIFY], + { "BeginVerify Message", "lmp.msg.beginverify", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_BEGIN_VERIFY_ACK], - { "BeginVerifyAck Message", "lmp.msg.beginverifyack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_BEGIN_VERIFY_ACK], + { "BeginVerifyAck Message", "lmp.msg.beginverifyack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_BEGIN_VERIFY_NACK], - { "BeginVerifyNack Message", "lmp.msg.beginverifynack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_BEGIN_VERIFY_NACK], + { "BeginVerifyNack Message", "lmp.msg.beginverifynack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_END_VERIFY], - { "EndVerify Message", "lmp.msg.endverify", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_END_VERIFY], + { "EndVerify Message", "lmp.msg.endverify", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_END_VERIFY_ACK], - { "EndVerifyAck Message", "lmp.msg.endverifyack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_END_VERIFY_ACK], + { "EndVerifyAck Message", "lmp.msg.endverifyack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_TEST], - { "Test Message", "lmp.msg.test", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_TEST], + { "Test Message", "lmp.msg.test", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_TEST_STATUS_SUCCESS], - { "TestStatusSuccess Message", "lmp.msg.teststatussuccess", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_TEST_STATUS_SUCCESS], + { "TestStatusSuccess Message", "lmp.msg.teststatussuccess", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_TEST_STATUS_FAILURE], - { "TestStatusFailure Message", "lmp.msg.teststatusfailure", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_TEST_STATUS_FAILURE], + { "TestStatusFailure Message", "lmp.msg.teststatusfailure", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_TEST_STATUS_ACK], - { "TestStatusAck Message", "lmp.msg.teststatusack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_TEST_STATUS_ACK], + { "TestStatusAck Message", "lmp.msg.teststatusack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_LINK_SUMMARY], - { "LinkSummary Message", "lmp.msg.linksummary", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_LINK_SUMMARY], + { "LinkSummary Message", "lmp.msg.linksummary", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_LINK_SUMMARY_ACK], - { "LinkSummaryAck Message", "lmp.msg.linksummaryack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_LINK_SUMMARY_ACK], + { "LinkSummaryAck Message", "lmp.msg.linksummaryack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_LINK_SUMMARY_NACK], - { "LinkSummaryNack Message", "lmp.msg.linksummarynack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_LINK_SUMMARY_NACK], + { "LinkSummaryNack Message", "lmp.msg.linksummarynack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_CHANNEL_STATUS], - { "ChannelStatus Message", "lmp.msg.channelstatus", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_CHANNEL_STATUS], + { "ChannelStatus Message", "lmp.msg.channelstatus", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_CHANNEL_STATUS_ACK], - { "ChannelStatusAck Message", "lmp.msg.channelstatusack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_CHANNEL_STATUS_ACK], + { "ChannelStatusAck Message", "lmp.msg.channelstatusack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_CHANNEL_STATUS_REQ], - { "ChannelStatusRequest Message", "lmp.msg.channelstatusrequest", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, + {&hf_lmp_filter[LMPF_MSG_CHANNEL_STATUS_REQ], + { "ChannelStatusRequest Message", "lmp.msg.channelstatusrequest", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, - {&hf_lmp_filter[LMPF_MSG_CHANNEL_STATUS_RESP], - { "ChannelStatusResponse Message", "lmp.msg.channelstatusresponse", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_TRACE_MONITOR], - { "TraceMonitor Message", "lmp.msg.tracemonitor", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_TRACE_MONITOR_ACK], - { "TraceMonitorAck Message", "lmp.msg.tracemonitorack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_TRACE_MONITOR_NACK], - { "TraceMonitorNack Message", "lmp.msg.tracemonitornack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_TRACE_MISMATCH], - { "TraceMismatch Message", "lmp.msg.tracemismatch", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_TRACE_MISMATCH_ACK], - { "TraceMismatchAck Message", "lmp.msg.tracemismatchack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_TRACE_REQUEST], - { "TraceRequest Message", "lmp.msg.tracerequest", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_TRACE_REPORT], - { "TraceReport Message", "lmp.msg.tracereport", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_TRACE_REQUEST_NACK], - { "TraceRequestNack Message", "lmp.msg.tracerequestnack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_INSERT_TRACE], - { "InsertTrace Message", "lmp.msg.inserttrace", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_INSERT_TRACE_ACK], - { "InsertTraceAck Message", "lmp.msg.inserttraceack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_INSERT_TRACE_NACK], - { "InsertTraceNack Message", "lmp.msg.inserttracenack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_SERVICE_CONFIG], - { "ServiceConfig Message", "lmp.msg.serviceconfig", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_SERVICE_CONFIG_ACK], - { "ServiceConfigAck Message", "lmp.msg.serviceconfigack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_SERVICE_CONFIG_NACK], - { "ServiceConfigNack Message", "lmp.msg.serviceconfignack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_DISCOVERY_RESP], - { "DiscoveryResponse Message", "lmp.msg.discoveryresp", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_DISCOVERY_RESP_ACK], - { "DiscoveryResponseAck Message", "lmp.msg.discoveryrespack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_MSG_DISCOVERY_RESP_NACK], - { "DiscoveryResponseNack Message", "lmp.msg.discoveryrespnack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - /* LMP Message Header Fields ------------------- */ - - {&hf_lmp_filter[LMPF_HDR_FLAGS], - { "LMP Header - Flags", "lmp.hdr.flags", FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_HDR_FLAGS_CC_DOWN], - { "ControlChannelDown", "lmp.hdr.ccdown", FT_BOOLEAN, 8, NULL, 0x01, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_HDR_FLAGS_REBOOT], - { "Reboot", "lmp.hdr.reboot", FT_BOOLEAN, 8, NULL, 0x02, - NULL, HFILL }}, - - /* LMP object class filters ------------------------------- */ - - {&hf_lmp_filter[LMPF_OBJECT], - { "LOCAL_CCID", "lmp.object", FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_CCID], - { "CCID", "lmp.obj.ccid", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_NODE_ID], - { "NODE_ID", "lmp.obj.Nodeid", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_LINK_ID], - { "LINK_ID", "lmp.obj.linkid", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_INTERFACE_ID], - { "INTERFACE_ID", "lmp.obj.interfaceid", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_MESSAGE_ID], - { "MESSAGE_ID", "lmp.obj.messageid", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_CONFIG], - { "CONFIG", "lmp.obj.config", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_HELLO], - { "HELLO", "lmp.obj.hello", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_BEGIN_VERIFY], - { "BEGIN_VERIFY", "lmp.obj.begin_verify", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_BEGIN_VERIFY_ACK], - { "BEGIN_VERIFY_ACK", "lmp.obj.begin_verify_ack", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_VERIFY_ID], - { "VERIFY_ID", "lmp.obj.verifyid", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_TE_LINK], - { "TE_LINK", "lmp.obj.te_link", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CLASS_DATA_LINK], - { "DATA_LINK", "lmp.obj.data_link", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_CHANNEL_STATUS], - { "CHANNEL_STATUS", "lmp.obj.channel_status", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_CHANNEL_STATUS_REQUEST], - { "CHANNEL_STATUS_REQUEST", "lmp.obj.channel_status_request", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_ERROR], - { "ERROR", "lmp.obj.error", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_TRACE], - { "TRACE", "lmp.obj.trace", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_TRACE_REQ], - { "TRACE REQ", "lmp.obj.trace_req", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_SERVICE_CONFIG], - { "SERVICE_CONFIG", "lmp.obj.serviceconfig", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_DA_DCN_ADDRESS], - { "DA_DCN_ADDRESS", "lmp.obj.dadcnaddr", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_CLASS_LOCAL_LAD_INFO], - { "LOCAL_LAD_INFO", "lmp.obj.localladinfo", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - /* Other LMP Value Filters ------------------------------ */ - - {&hf_lmp_filter[LMPF_VAL_CTYPE], - { "Object C-Type", "lmp.obj.ctype", FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_LOCAL_CCID], - { "Local CCID Value", "lmp.local_ccid", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_REMOTE_CCID], - { "Remote CCID Value", "lmp.remote_ccid", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_LOCAL_NODE_ID], - { "Local Node ID Value", "lmp.local_nodeid", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_REMOTE_NODE_ID], - { "Remote Node ID Value", "lmp.remote_nodeid", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_LOCAL_LINK_ID_IPV4], - { "Local Link ID - IPv4", "lmp.local_linkid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LOCAL_LINK_ID_IPV6], - { "Local Link ID - IPv6", "lmp.local_linkid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LOCAL_LINK_ID_UNNUM], - { "Local Link ID - Unnumbered", "lmp.local_linkid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_REMOTE_LINK_ID_IPV4], - { "Remote Link ID - IPv4", "lmp.remote_linkid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_REMOTE_LINK_ID_IPV6], - { "Remote Link ID - IPv6", "lmp.remote_linkid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_REMOTE_LINK_ID_UNNUM], - { "Remote Link ID - Unnumbered", "lmp.remote_linkid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_LOCAL_INTERFACE_ID_IPV4], - { "Local Interface ID - IPv4", "lmp.local_interfaceid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LOCAL_INTERFACE_ID_IPV6], - { "Local Interface ID - IPv6", "lmp.local_interfaceid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LOCAL_INTERFACE_ID_UNNUM], - { "Local Interface ID - Unnumbered", "lmp.local_interfaceid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_REMOTE_INTERFACE_ID_IPV4], - { "Remote Interface ID - IPv4", "lmp.remote_interfaceid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_REMOTE_INTERFACE_ID_IPV6], - { "Remote Interface ID - IPv6", "lmp.remote_interfaceid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_REMOTE_INTERFACE_ID_UNNUM], - { "Remote Interface ID - Unnumbered", "lmp.remote_interfaceid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_IPV4], - { "Interface ID: IPv4", "lmp.channel_status_interfaceid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_IPV6], - { "Interface ID: IPv6", "lmp.channel_status_interfaceid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_UNNUM], - { "Interface ID: Unnumbered", "lmp.channel_status_interfaceid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_MESSAGE_ID], - { "Message-ID Value", "lmp.messageid", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_MESSAGE_ID_ACK], - { "Message-ID Ack Value", "lmp.messageid_ack", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_CONFIG_HELLO], - { "HelloInterval", "lmp.hellointerval", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_CONFIG_HELLO_DEAD], - { "HelloDeadInterval", "lmp.hellodeadinterval", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_HELLO_TXSEQ], - { "TxSeqNum", "lmp.txseqnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_HELLO_RXSEQ], - { "RxSeqNum", "lmp.rxseqnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS], - { "Flags", "lmp.begin_verify.flags", FT_UINT16, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS_ALL_LINKS], - { "Verify All Links", "lmp.begin_verify.all_links", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS_LINK_TYPE], - { "Data Link Type", "lmp.begin_verify.link_type", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_ENCTYPE], - { "Encoding Type", "lmp.begin_verify.enctype", - FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gmpls_lsp_enc_rvals), 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_VERIFY_ID], - { "Verify-ID", "lmp.verifyid", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS], - { "TE-Link Flags", "lmp.te_link_flags", FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS_FAULT_MGMT], - { "Fault Management Supported", "lmp.te_link.fault_mgmt", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS_LINK_VERIFY], - { "Link Verification Supported", "lmp.te_link.link_verify", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_IPV4], - { "TE-Link Local ID - IPv4", "lmp.te_link.local_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_IPV6], - { "TE-Link Local ID - IPv6", "lmp.te_link.local_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_UNNUM], - { "TE-Link Local ID - Unnumbered", "lmp.te_link.local_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_IPV4], - { "TE-Link Remote ID - IPv4", "lmp.te_link.remote_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_IPV6], - { "TE-Link Remote ID - IPv6", "lmp.te_link.remote_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_UNNUM], - { "TE-Link Remote ID - Unnumbered", "lmp.te_link.remote_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS], - { "Data-Link Flags", "lmp.data_link_flags", FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS_PORT], - { "Data-Link is Individual Port", "lmp.data_link.port", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS_ALLOCATED], - { "Data-Link is Allocated", "lmp.data_link.link_verify", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_LOCAL_IPV4], - { "Data-Link Local ID - IPv4", "lmp.data_link.local_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_LOCAL_UNNUM], - { "Data-Link Local ID - Unnumbered", "lmp.data_link.local_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_REMOTE_IPV4], - { "Data-Link Remote ID - IPv4", "lmp.data_link.remote_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_REMOTE_UNNUM], - { "Data-Link Remote ID - Unnumbered", "lmp.data_link.remote_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ], - { "Subobject", "lmp.data_link_subobj", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ_SWITCHING_TYPE], - { "Interface Switching Capability", "lmp.data_link_switching", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, - RVALS(gmpls_switching_type_rvals), 0x0, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ_LSP_ENCODING], - { "LSP Encoding Type", "lmp.data_link_encoding", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, - RVALS(gmpls_lsp_enc_rvals), 0x0, NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_ERROR], - { "Error Code", "lmp.error", FT_UINT32, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNSUPPORTED_LINK], - { "Verification - Unsupported for this TE-Link", "lmp.error.verify_unsupported_link", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNWILLING], - { "Verification - Unwilling to Verify at this time", "lmp.error.verify_unwilling", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_TRANSPORT], - { "Verification - Transport Unsupported", "lmp.error.verify_unsupported_transport", - FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_TE_LINK_ID], - { "Verification - TE Link ID Configuration Error", "lmp.error.verify_te_link_id", - FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNKNOWN_CTYPE], - { "Verification - Unknown Object C-Type", "lmp.error.verify_unknown_ctype", - FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_PARAMETERS], - { "Summary - Unacceptable non-negotiable parameters", "lmp.error.summary_bad_params", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_RENEGOTIATE], - { "Summary - Renegotiate Parametere", "lmp.error.summary_renegotiate", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_TE_LINK], - { "Summary - Bad TE Link Object", "lmp.error.summary_bad_te_link", - FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_DATA_LINK], - { "Summary - Bad Data Link Object", "lmp.error.summary_bad_data_link", - FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_UNKNOWN_TEL_CTYPE], - { "Summary - Bad TE Link C-Type", "lmp.error.summary_unknown_tel_ctype", - FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_UNKNOWN_DL_CTYPE], - { "Summary - Bad Data Link C-Type", "lmp.error.summary_unknown_dl_ctype", - FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_REMOTE_LINK_ID], - { "Summary - Bad Remote Link ID", "lmp.error.summary_bad_remote_link_id", - FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_CONFIG_BAD_PARAMETERS], - { "Config - Unacceptable non-negotiable parameters", "lmp.error.config_bad_params", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_CONFIG_RENEGOTIATE], - { "Config - Renegotiate Parameter", "lmp.error.config_renegotiate", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_CONFIG_BAD_CCID], - { "Config - Bad CC ID", "lmp.error.config_bad_ccid", - FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_TRACE_UNSUPPORTED_TYPE], - { "Trace - Unsupported trace type", "lmp.error.trace_unsupported_type", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_TRACE_INVALID_MSG], - { "Trace - Invalid Trace Message", "lmp.error.trace_invalid_msg", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_TRACE_UNKNOWN_CTYPE], - { "Trace - Unknown Object C-Type", "lmp.error.trace_unknown_ctype", - FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_AREA_ID_MISMATCH], - { "LAD - Domain Routing Area ID Mismatch detected", "lmp.error.lad_area_id_mismatch", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_TCP_ID_MISMATCH], - { "LAD - TCP ID Mismatch detected", "lmp.error.lad_tcp_id_mismatch", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_DA_DCN_MISMATCH], - { "LAD - DA DCN Mismatch detected", "lmp.error.lad_da_dcn_mismatch", - FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_CAPABILITY_MISMATCH], - { "LAD - Capability Mismatch detected", "lmp.error.lad_capability_mismatch", - FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_UNKNOWN_CTYPE], - { "LAD - Unknown Object C-Type", "lmp.error.lad_unknown_ctype", - FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_TYPE], - { "Local Trace Type", "lmp.trace.local_type", FT_UINT16, BASE_DEC, - VALS(lmp_trace_type_str), 0x0, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_LEN], - { "Local Trace Length", "lmp.trace.local_length", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_MSG], - { "Local Trace Message", "lmp.trace.local_msg", FT_STRING, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_TYPE], - { "Remote Trace Type", "lmp.trace.remote_type", FT_UINT16, BASE_DEC, - VALS(lmp_trace_type_str), 0x0, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_LEN], - { "Remote Trace Length", "lmp.trace.remote_length", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_MSG], - { "Remote Trace Message", "lmp.trace.remote_msg", FT_STRING, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_TRACE_REQ_TYPE], - { "Trace Type", "lmp.trace_req.type", FT_UINT16, BASE_DEC, - VALS(lmp_trace_type_str), 0x0, NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS], - { "Service Config - Supported Signalling Protocols", - "lmp.service_config.sp", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS_RSVP], - { "RSVP is supported", "lmp.service_config.sp.rsvp", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS_LDP], - { "LDP is supported", "lmp.service_config.sp.ldp", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS], - { "Client Port Service Attributes", "lmp.service_config.cpsa", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_PATH_OVERHEAD], - { "Path/VC Overhead Transparency Supported", - "lmp.service_config.cpsa.path_overhead", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_LINE_OVERHEAD], - { "Line/MS Overhead Transparency Supported", - "lmp.service_config.cpsa.line_overhead", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_SECTION_OVERHEAD], - { "Section/RS Overhead Transparency Supported", - "lmp.service_config.cpsa.section_overhead", - FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_CCT_FLAGS], - { "Contiguous Concatenation Types", "lmp.service_config.cct", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_CCT_FLAGS_CC_SUPPORTED], - { "Contiguous Concatenation Types Supported", - "lmp.service_config.cpsa.line_overhead", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MIN_NCC], - { "Minimum Number of Contiguously Concatenated Components", - "lmp.service_config.cpsa.min_ncc", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MAX_NCC], - { "Maximum Number of Contiguously Concatenated Components", - "lmp.service_config.cpsa.max_ncc", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MIN_NVC], - { "Maximum Number of Contiguously Concatenated Components", - "lmp.service_config.cpsa.min_nvc", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MAX_NVC], - { "Minimum Number of Virtually Concatenated Components", - "lmp.service_config.cpsa.max_nvc", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_INTERFACE_ID], - { "Local interface id of the client interface referred to", - "lmp.service_config.cpsa.local_ifid", - FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS], - { "Network Transparency Flags", - "lmp.service_config.nsa.transparency", - FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS_SOH], - { "Standard SOH/RSOH transparency supported", - "lmp.service_config.nsa.transparency.soh", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS_LOH], - { "Standard LOH/MSOH transparency supported", - "lmp.service_config.nsa.transparency.loh", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TCM_FLAGS], - { "TCM Monitoring", - "lmp.service_config.nsa.tcm", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TCM_FLAGS_TCM_SUPPORTED], - { "TCM Monitoring Supported", - "lmp.service_config.nsa.transparency.tcm", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS], - { "Network Diversity Flags", - "lmp.service_config.nsa.diversity", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_NODE], - { "Node diversity supported", - "lmp.service_config.nsa.diversity.node", - FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_LINK], - { "Link diversity supported", - "lmp.service_config.nsa.diversity.link", - FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_SRLG], - { "SRLG diversity supported", - "lmp.service_config.nsa.diversity.srlg", - FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, - - {&hf_lmp_filter[LMPF_VAL_LOCAL_DA_DCN_ADDR], - { "Local DA DCN Address", "lmp.local_da_dcn_addr", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_REMOTE_DA_DCN_ADDR], - { "Remote DA DCN Address", "lmp.remote_da_dcn_addr", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_NODE_ID], - { "Node ID", "lmp.local_lad_node_id", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_AREA_ID], - { "Area ID", "lmp.local_lad_area_id", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_TE_LINK_ID], - { "TE Link ID", "lmp.local_lad_telink_id", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_COMPONENT_ID], - { "Component Link ID", "lmp.local_lad_comp_id", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_SC_PC_ID], - { "SC PC ID", "lmp.local_lad_sc_pc_id", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_SC_PC_ADDR], - { "SC PC Address", "lmp.local_lad_sc_pc_addr", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ], - { "Subobject", "lmp.lad_info_subobj", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_AREA_ID], - { "SC PC Address", "lmp.lad_pri_area_id", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_RC_PC_ID], - { "SC PC Address", "lmp.lad_pri_rc_pc_id", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_RC_PC_ADDR], - { "SC PC Address", "lmp.lad_pri_rc_pc_addr", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_AREA_ID], - { "SC PC Address", "lmp.lad_sec_area_id", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_RC_PC_ID], - { "SC PC Address", "lmp.lad_sec_rc_pc_id", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_RC_PC_ADDR], - { "SC PC Address", "lmp.lad_sec_rc_pc_addr", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SWITCHING_TYPE], - { "Interface Switching Capability", "lmp.lad_switching", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, - RVALS(gmpls_switching_type_rvals), 0x0, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_LSP_ENCODING], - { "LSP Encoding Type", "lmp.lad_encoding", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, - RVALS(gmpls_lsp_enc_rvals), 0x0, NULL, HFILL }}, - {&hf_lmp_filter[LMPF_CHECKSUM], - { "Message Checksum", "lmp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - {&hf_lmp_data, - { "Data", "lmp.data", FT_BYTES, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - }; + {&hf_lmp_filter[LMPF_MSG_CHANNEL_STATUS_RESP], + { "ChannelStatusResponse Message", "lmp.msg.channelstatusresponse", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_TRACE_MONITOR], + { "TraceMonitor Message", "lmp.msg.tracemonitor", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_TRACE_MONITOR_ACK], + { "TraceMonitorAck Message", "lmp.msg.tracemonitorack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_TRACE_MONITOR_NACK], + { "TraceMonitorNack Message", "lmp.msg.tracemonitornack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_TRACE_MISMATCH], + { "TraceMismatch Message", "lmp.msg.tracemismatch", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_TRACE_MISMATCH_ACK], + { "TraceMismatchAck Message", "lmp.msg.tracemismatchack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_TRACE_REQUEST], + { "TraceRequest Message", "lmp.msg.tracerequest", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_TRACE_REPORT], + { "TraceReport Message", "lmp.msg.tracereport", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_TRACE_REQUEST_NACK], + { "TraceRequestNack Message", "lmp.msg.tracerequestnack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_INSERT_TRACE], + { "InsertTrace Message", "lmp.msg.inserttrace", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_INSERT_TRACE_ACK], + { "InsertTraceAck Message", "lmp.msg.inserttraceack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_INSERT_TRACE_NACK], + { "InsertTraceNack Message", "lmp.msg.inserttracenack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_SERVICE_CONFIG], + { "ServiceConfig Message", "lmp.msg.serviceconfig", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_SERVICE_CONFIG_ACK], + { "ServiceConfigAck Message", "lmp.msg.serviceconfigack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_SERVICE_CONFIG_NACK], + { "ServiceConfigNack Message", "lmp.msg.serviceconfignack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_DISCOVERY_RESP], + { "DiscoveryResponse Message", "lmp.msg.discoveryresp", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_DISCOVERY_RESP_ACK], + { "DiscoveryResponseAck Message", "lmp.msg.discoveryrespack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_MSG_DISCOVERY_RESP_NACK], + { "DiscoveryResponseNack Message", "lmp.msg.discoveryrespnack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + /* LMP Message Header Fields ------------------- */ + + {&hf_lmp_filter[LMPF_HDR_FLAGS], + { "LMP Header - Flags", "lmp.hdr.flags", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_HDR_FLAGS_CC_DOWN], + { "ControlChannelDown", "lmp.hdr.ccdown", FT_BOOLEAN, 8, NULL, 0x01, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_HDR_FLAGS_REBOOT], + { "Reboot", "lmp.hdr.reboot", FT_BOOLEAN, 8, NULL, 0x02, + NULL, HFILL }}, + + /* LMP object class filters ------------------------------- */ + + {&hf_lmp_filter[LMPF_OBJECT], + { "LOCAL_CCID", "lmp.object", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_CCID], + { "CCID", "lmp.obj.ccid", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_NODE_ID], + { "NODE_ID", "lmp.obj.Nodeid", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_LINK_ID], + { "LINK_ID", "lmp.obj.linkid", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_INTERFACE_ID], + { "INTERFACE_ID", "lmp.obj.interfaceid", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_MESSAGE_ID], + { "MESSAGE_ID", "lmp.obj.messageid", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_CONFIG], + { "CONFIG", "lmp.obj.config", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_HELLO], + { "HELLO", "lmp.obj.hello", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_BEGIN_VERIFY], + { "BEGIN_VERIFY", "lmp.obj.begin_verify", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_BEGIN_VERIFY_ACK], + { "BEGIN_VERIFY_ACK", "lmp.obj.begin_verify_ack", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_VERIFY_ID], + { "VERIFY_ID", "lmp.obj.verifyid", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_TE_LINK], + { "TE_LINK", "lmp.obj.te_link", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CLASS_DATA_LINK], + { "DATA_LINK", "lmp.obj.data_link", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_CHANNEL_STATUS], + { "CHANNEL_STATUS", "lmp.obj.channel_status", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_CHANNEL_STATUS_REQUEST], + { "CHANNEL_STATUS_REQUEST", "lmp.obj.channel_status_request", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_ERROR], + { "ERROR", "lmp.obj.error", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_TRACE], + { "TRACE", "lmp.obj.trace", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_TRACE_REQ], + { "TRACE REQ", "lmp.obj.trace_req", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_SERVICE_CONFIG], + { "SERVICE_CONFIG", "lmp.obj.serviceconfig", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_DA_DCN_ADDRESS], + { "DA_DCN_ADDRESS", "lmp.obj.dadcnaddr", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_CLASS_LOCAL_LAD_INFO], + { "LOCAL_LAD_INFO", "lmp.obj.localladinfo", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + /* Other LMP Value Filters ------------------------------ */ + + {&hf_lmp_filter[LMPF_VAL_CTYPE], + { "Object C-Type", "lmp.obj.ctype", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_LOCAL_CCID], + { "Local CCID Value", "lmp.local_ccid", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_REMOTE_CCID], + { "Remote CCID Value", "lmp.remote_ccid", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_LOCAL_NODE_ID], + { "Local Node ID Value", "lmp.local_nodeid", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_REMOTE_NODE_ID], + { "Remote Node ID Value", "lmp.remote_nodeid", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_LOCAL_LINK_ID_IPV4], + { "Local Link ID - IPv4", "lmp.local_linkid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LOCAL_LINK_ID_IPV6], + { "Local Link ID - IPv6", "lmp.local_linkid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LOCAL_LINK_ID_UNNUM], + { "Local Link ID - Unnumbered", "lmp.local_linkid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_REMOTE_LINK_ID_IPV4], + { "Remote Link ID - IPv4", "lmp.remote_linkid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_REMOTE_LINK_ID_IPV6], + { "Remote Link ID - IPv6", "lmp.remote_linkid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_REMOTE_LINK_ID_UNNUM], + { "Remote Link ID - Unnumbered", "lmp.remote_linkid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_LOCAL_INTERFACE_ID_IPV4], + { "Local Interface ID - IPv4", "lmp.local_interfaceid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LOCAL_INTERFACE_ID_IPV6], + { "Local Interface ID - IPv6", "lmp.local_interfaceid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LOCAL_INTERFACE_ID_UNNUM], + { "Local Interface ID - Unnumbered", "lmp.local_interfaceid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_REMOTE_INTERFACE_ID_IPV4], + { "Remote Interface ID - IPv4", "lmp.remote_interfaceid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_REMOTE_INTERFACE_ID_IPV6], + { "Remote Interface ID - IPv6", "lmp.remote_interfaceid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_REMOTE_INTERFACE_ID_UNNUM], + { "Remote Interface ID - Unnumbered", "lmp.remote_interfaceid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_IPV4], + { "Interface ID: IPv4", "lmp.channel_status_interfaceid_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_IPV6], + { "Interface ID: IPv6", "lmp.channel_status_interfaceid_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_CHANNEL_STATUS_INTERFACE_ID_UNNUM], + { "Interface ID: Unnumbered", "lmp.channel_status_interfaceid_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_MESSAGE_ID], + { "Message-ID Value", "lmp.messageid", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_MESSAGE_ID_ACK], + { "Message-ID Ack Value", "lmp.messageid_ack", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_CONFIG_HELLO], + { "HelloInterval", "lmp.hellointerval", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_CONFIG_HELLO_DEAD], + { "HelloDeadInterval", "lmp.hellodeadinterval", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_HELLO_TXSEQ], + { "TxSeqNum", "lmp.txseqnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_HELLO_RXSEQ], + { "RxSeqNum", "lmp.rxseqnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS], + { "Flags", "lmp.begin_verify.flags", FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS_ALL_LINKS], + { "Verify All Links", "lmp.begin_verify.all_links", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_FLAGS_LINK_TYPE], + { "Data Link Type", "lmp.begin_verify.link_type", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_BEGIN_VERIFY_ENCTYPE], + { "Encoding Type", "lmp.begin_verify.enctype", + FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(gmpls_lsp_enc_rvals), 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_VERIFY_ID], + { "Verify-ID", "lmp.verifyid", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS], + { "TE-Link Flags", "lmp.te_link_flags", FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS_FAULT_MGMT], + { "Fault Management Supported", "lmp.te_link.fault_mgmt", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TE_LINK_FLAGS_LINK_VERIFY], + { "Link Verification Supported", "lmp.te_link.link_verify", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_IPV4], + { "TE-Link Local ID - IPv4", "lmp.te_link.local_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_IPV6], + { "TE-Link Local ID - IPv6", "lmp.te_link.local_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TE_LINK_LOCAL_UNNUM], + { "TE-Link Local ID - Unnumbered", "lmp.te_link.local_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_IPV4], + { "TE-Link Remote ID - IPv4", "lmp.te_link.remote_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_IPV6], + { "TE-Link Remote ID - IPv6", "lmp.te_link.remote_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TE_LINK_REMOTE_UNNUM], + { "TE-Link Remote ID - Unnumbered", "lmp.te_link.remote_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS], + { "Data-Link Flags", "lmp.data_link_flags", FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS_PORT], + { "Data-Link is Individual Port", "lmp.data_link.port", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_FLAGS_ALLOCATED], + { "Data-Link is Allocated", "lmp.data_link.link_verify", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_LOCAL_IPV4], + { "Data-Link Local ID - IPv4", "lmp.data_link.local_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_LOCAL_UNNUM], + { "Data-Link Local ID - Unnumbered", "lmp.data_link.local_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_REMOTE_IPV4], + { "Data-Link Remote ID - IPv4", "lmp.data_link.remote_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_REMOTE_UNNUM], + { "Data-Link Remote ID - Unnumbered", "lmp.data_link.remote_unnum", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ], + { "Subobject", "lmp.data_link_subobj", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ_SWITCHING_TYPE], + { "Interface Switching Capability", "lmp.data_link_switching", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, + RVALS(gmpls_switching_type_rvals), 0x0, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_DATA_LINK_SUBOBJ_LSP_ENCODING], + { "LSP Encoding Type", "lmp.data_link_encoding", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, + RVALS(gmpls_lsp_enc_rvals), 0x0, NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_ERROR], + { "Error Code", "lmp.error", FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNSUPPORTED_LINK], + { "Verification - Unsupported for this TE-Link", "lmp.error.verify_unsupported_link", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNWILLING], + { "Verification - Unwilling to Verify at this time", "lmp.error.verify_unwilling", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_TRANSPORT], + { "Verification - Transport Unsupported", "lmp.error.verify_unsupported_transport", + FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_TE_LINK_ID], + { "Verification - TE Link ID Configuration Error", "lmp.error.verify_te_link_id", + FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_ERROR_VERIFY_UNKNOWN_CTYPE], + { "Verification - Unknown Object C-Type", "lmp.error.verify_unknown_ctype", + FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_PARAMETERS], + { "Summary - Unacceptable non-negotiable parameters", "lmp.error.summary_bad_params", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_RENEGOTIATE], + { "Summary - Renegotiate Parametere", "lmp.error.summary_renegotiate", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_TE_LINK], + { "Summary - Bad TE Link Object", "lmp.error.summary_bad_te_link", + FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_DATA_LINK], + { "Summary - Bad Data Link Object", "lmp.error.summary_bad_data_link", + FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_UNKNOWN_TEL_CTYPE], + { "Summary - Bad TE Link C-Type", "lmp.error.summary_unknown_tel_ctype", + FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_UNKNOWN_DL_CTYPE], + { "Summary - Bad Data Link C-Type", "lmp.error.summary_unknown_dl_ctype", + FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_SUMMARY_BAD_REMOTE_LINK_ID], + { "Summary - Bad Remote Link ID", "lmp.error.summary_bad_remote_link_id", + FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_CONFIG_BAD_PARAMETERS], + { "Config - Unacceptable non-negotiable parameters", "lmp.error.config_bad_params", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_CONFIG_RENEGOTIATE], + { "Config - Renegotiate Parameter", "lmp.error.config_renegotiate", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_CONFIG_BAD_CCID], + { "Config - Bad CC ID", "lmp.error.config_bad_ccid", + FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_TRACE_UNSUPPORTED_TYPE], + { "Trace - Unsupported trace type", "lmp.error.trace_unsupported_type", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_TRACE_INVALID_MSG], + { "Trace - Invalid Trace Message", "lmp.error.trace_invalid_msg", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_TRACE_UNKNOWN_CTYPE], + { "Trace - Unknown Object C-Type", "lmp.error.trace_unknown_ctype", + FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_AREA_ID_MISMATCH], + { "LAD - Domain Routing Area ID Mismatch detected", "lmp.error.lad_area_id_mismatch", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_TCP_ID_MISMATCH], + { "LAD - TCP ID Mismatch detected", "lmp.error.lad_tcp_id_mismatch", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_DA_DCN_MISMATCH], + { "LAD - DA DCN Mismatch detected", "lmp.error.lad_da_dcn_mismatch", + FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_CAPABILITY_MISMATCH], + { "LAD - Capability Mismatch detected", "lmp.error.lad_capability_mismatch", + FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_ERROR_LAD_UNKNOWN_CTYPE], + { "LAD - Unknown Object C-Type", "lmp.error.lad_unknown_ctype", + FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_TYPE], + { "Local Trace Type", "lmp.trace.local_type", FT_UINT16, BASE_DEC, + VALS(lmp_trace_type_str), 0x0, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_LEN], + { "Local Trace Length", "lmp.trace.local_length", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TRACE_LOCAL_MSG], + { "Local Trace Message", "lmp.trace.local_msg", FT_STRING, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_TYPE], + { "Remote Trace Type", "lmp.trace.remote_type", FT_UINT16, BASE_DEC, + VALS(lmp_trace_type_str), 0x0, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_LEN], + { "Remote Trace Length", "lmp.trace.remote_length", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_TRACE_REMOTE_MSG], + { "Remote Trace Message", "lmp.trace.remote_msg", FT_STRING, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_TRACE_REQ_TYPE], + { "Trace Type", "lmp.trace_req.type", FT_UINT16, BASE_DEC, + VALS(lmp_trace_type_str), 0x0, NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS], + { "Service Config - Supported Signalling Protocols", + "lmp.service_config.sp", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS_RSVP], + { "RSVP is supported", "lmp.service_config.sp.rsvp", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_SP_FLAGS_LDP], + { "LDP is supported", "lmp.service_config.sp.ldp", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS], + { "Client Port Service Attributes", "lmp.service_config.cpsa", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_PATH_OVERHEAD], + { "Path/VC Overhead Transparency Supported", + "lmp.service_config.cpsa.path_overhead", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_LINE_OVERHEAD], + { "Line/MS Overhead Transparency Supported", + "lmp.service_config.cpsa.line_overhead", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_TP_FLAGS_SECTION_OVERHEAD], + { "Section/RS Overhead Transparency Supported", + "lmp.service_config.cpsa.section_overhead", + FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_CCT_FLAGS], + { "Contiguous Concatenation Types", "lmp.service_config.cct", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_CCT_FLAGS_CC_SUPPORTED], + { "Contiguous Concatenation Types Supported", + "lmp.service_config.cpsa.line_overhead", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MIN_NCC], + { "Minimum Number of Contiguously Concatenated Components", + "lmp.service_config.cpsa.min_ncc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MAX_NCC], + { "Maximum Number of Contiguously Concatenated Components", + "lmp.service_config.cpsa.max_ncc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MIN_NVC], + { "Maximum Number of Contiguously Concatenated Components", + "lmp.service_config.cpsa.min_nvc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_MAX_NVC], + { "Minimum Number of Virtually Concatenated Components", + "lmp.service_config.cpsa.max_nvc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_CPSA_INTERFACE_ID], + { "Local interface id of the client interface referred to", + "lmp.service_config.cpsa.local_ifid", + FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS], + { "Network Transparency Flags", + "lmp.service_config.nsa.transparency", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS_SOH], + { "Standard SOH/RSOH transparency supported", + "lmp.service_config.nsa.transparency.soh", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TRANSPARENCY_FLAGS_LOH], + { "Standard LOH/MSOH transparency supported", + "lmp.service_config.nsa.transparency.loh", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TCM_FLAGS], + { "TCM Monitoring", + "lmp.service_config.nsa.tcm", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_TCM_FLAGS_TCM_SUPPORTED], + { "TCM Monitoring Supported", + "lmp.service_config.nsa.transparency.tcm", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS], + { "Network Diversity Flags", + "lmp.service_config.nsa.diversity", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_NODE], + { "Node diversity supported", + "lmp.service_config.nsa.diversity.node", + FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_LINK], + { "Link diversity supported", + "lmp.service_config.nsa.diversity.link", + FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_SERVICE_CONFIG_NSA_NETWORK_DIVERSITY_FLAGS_SRLG], + { "SRLG diversity supported", + "lmp.service_config.nsa.diversity.srlg", + FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}}, + + {&hf_lmp_filter[LMPF_VAL_LOCAL_DA_DCN_ADDR], + { "Local DA DCN Address", "lmp.local_da_dcn_addr", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_REMOTE_DA_DCN_ADDR], + { "Remote DA DCN Address", "lmp.remote_da_dcn_addr", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_NODE_ID], + { "Node ID", "lmp.local_lad_node_id", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_AREA_ID], + { "Area ID", "lmp.local_lad_area_id", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_TE_LINK_ID], + { "TE Link ID", "lmp.local_lad_telink_id", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_COMPONENT_ID], + { "Component Link ID", "lmp.local_lad_comp_id", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_SC_PC_ID], + { "SC PC ID", "lmp.local_lad_sc_pc_id", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LOCAL_LAD_INFO_SC_PC_ADDR], + { "SC PC Address", "lmp.local_lad_sc_pc_addr", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ], + { "Subobject", "lmp.lad_info_subobj", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_AREA_ID], + { "SC PC Address", "lmp.lad_pri_area_id", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_RC_PC_ID], + { "SC PC Address", "lmp.lad_pri_rc_pc_id", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_PRI_RC_PC_ADDR], + { "SC PC Address", "lmp.lad_pri_rc_pc_addr", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_AREA_ID], + { "SC PC Address", "lmp.lad_sec_area_id", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_RC_PC_ID], + { "SC PC Address", "lmp.lad_sec_rc_pc_id", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SEC_RC_PC_ADDR], + { "SC PC Address", "lmp.lad_sec_rc_pc_addr", FT_IPv4, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_SWITCHING_TYPE], + { "Interface Switching Capability", "lmp.lad_switching", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, + RVALS(gmpls_switching_type_rvals), 0x0, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_VAL_LAD_INFO_SUBOBJ_LSP_ENCODING], + { "LSP Encoding Type", "lmp.lad_encoding", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, + RVALS(gmpls_lsp_enc_rvals), 0x0, NULL, HFILL }}, + {&hf_lmp_filter[LMPF_CHECKSUM], + { "Message Checksum", "lmp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + {&hf_lmp_data, + { "Data", "lmp.data", FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + }; static ei_register_info ei[] = { { &ei_lmp_checksum_incorrect, { "lmp.checksum.incorrect", PI_PROTOCOL, PI_WARN, "Incorrect checksum", EXPFILL }}, @@ -2685,15 +2685,15 @@ proto_register_lmp(void) expert_module_t* expert_lmp; for (i=0; i<NUM_LMP_SUBTREES; i++) { - lmp_subtree[i] = -1; - ett[i] = &lmp_subtree[i]; + lmp_subtree[i] = -1; + ett[i] = &lmp_subtree[i]; } expert_lmp = expert_register_protocol(proto_lmp); expert_register_field_array(expert_lmp, ei, array_length(ei)); proto_lmp = proto_register_protocol("Link Management Protocol (LMP)", - "LMP", "lmp"); + "LMP", "lmp"); proto_register_field_array(proto_lmp, lmpf_info, array_length(lmpf_info)); proto_register_subtree_array(ett, array_length(ett)); @@ -2706,3 +2706,16 @@ proto_reg_handoff_lmp(void) lmp_handle = new_create_dissector_handle(dissect_lmp, proto_lmp); dissector_add_uint("udp.port", lmp_udp_port, lmp_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c index 306c5078c1..6d80907f66 100644 --- a/epan/dissectors/packet-mmse.c +++ b/epan/dissectors/packet-mmse.c @@ -47,9 +47,9 @@ void proto_register_mmse(void); void proto_reg_handoff_mmse(void); -#define MM_QUOTE 0x7F /* Quoted string */ +#define MM_QUOTE 0x7F /* Quoted string */ -#define MMS_CONTENT_TYPE 0x3E /* WINA-value for mms-message */ +#define MMS_CONTENT_TYPE 0x3E /* WINA-value for mms-message */ /* General-purpose debug logger. * Requires double parentheses because of variable arguments of printf(). @@ -59,8 +59,8 @@ void proto_reg_handoff_mmse(void); */ #ifdef DEBUG_mmse #define DebugLog(x) \ - g_print("%s:%u: ", __FILE__, __LINE__); \ - g_print x + g_print("%s:%u: ", __FILE__, __LINE__); \ + g_print x #else #define DebugLog(x) ; #endif @@ -70,178 +70,178 @@ void proto_reg_handoff_mmse(void); */ static void dissect_mmse_standalone(tvbuff_t *, packet_info *, proto_tree *); static void dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - guint8 pdut, const char *message_type); + guint8 pdut, const char *message_type); /* * Header field values */ /* MMS 1.0 */ -#define MM_BCC_HDR 0x81 /* Bcc */ -#define MM_CC_HDR 0x82 /* Cc */ -#define MM_CLOCATION_HDR 0x83 /* X-Mms-Content-Location */ -#define MM_CTYPE_HDR 0x84 /* Content-Type */ -#define MM_DATE_HDR 0x85 /* Date */ -#define MM_DREPORT_HDR 0x86 /* X-Mms-Delivery-Report */ -#define MM_DTIME_HDR 0x87 /* X-Mms-Delivery-Time */ -#define MM_EXPIRY_HDR 0x88 /* X-Mms-Expiry */ -#define MM_FROM_HDR 0x89 /* From */ -#define MM_MCLASS_HDR 0x8A /* X-Mms-Message-Class */ -#define MM_MID_HDR 0x8B /* Message-ID */ -#define MM_MTYPE_HDR 0x8C /* X-Mms-Message-Type */ -#define MM_VERSION_HDR 0x8D /* X-Mms-MMS-Version */ -#define MM_MSIZE_HDR 0x8E /* X-Mms-Message-Size */ -#define MM_PRIORITY_HDR 0x8F /* X-Mms-Priority */ -#define MM_RREPLY_HDR 0x90 /* X-Mms-Read-Reply */ -#define MM_RALLOWED_HDR 0x91 /* X-Mms-Report-Allowed */ -#define MM_RSTATUS_HDR 0x92 /* X-Mms-Response-Status */ -#define MM_RTEXT_HDR 0x93 /* X-Mms-Response-Text */ -#define MM_SVISIBILITY_HDR 0x94 /* X-Mms-Sender-Visibility */ -#define MM_STATUS_HDR 0x95 /* X-Mms-Status */ -#define MM_SUBJECT_HDR 0x96 /* Subject */ -#define MM_TO_HDR 0x97 /* To */ -#define MM_TID_HDR 0x98 /* X-Mms-Transaction-Id */ +#define MM_BCC_HDR 0x81 /* Bcc */ +#define MM_CC_HDR 0x82 /* Cc */ +#define MM_CLOCATION_HDR 0x83 /* X-Mms-Content-Location */ +#define MM_CTYPE_HDR 0x84 /* Content-Type */ +#define MM_DATE_HDR 0x85 /* Date */ +#define MM_DREPORT_HDR 0x86 /* X-Mms-Delivery-Report */ +#define MM_DTIME_HDR 0x87 /* X-Mms-Delivery-Time */ +#define MM_EXPIRY_HDR 0x88 /* X-Mms-Expiry */ +#define MM_FROM_HDR 0x89 /* From */ +#define MM_MCLASS_HDR 0x8A /* X-Mms-Message-Class */ +#define MM_MID_HDR 0x8B /* Message-ID */ +#define MM_MTYPE_HDR 0x8C /* X-Mms-Message-Type */ +#define MM_VERSION_HDR 0x8D /* X-Mms-MMS-Version */ +#define MM_MSIZE_HDR 0x8E /* X-Mms-Message-Size */ +#define MM_PRIORITY_HDR 0x8F /* X-Mms-Priority */ +#define MM_RREPLY_HDR 0x90 /* X-Mms-Read-Reply */ +#define MM_RALLOWED_HDR 0x91 /* X-Mms-Report-Allowed */ +#define MM_RSTATUS_HDR 0x92 /* X-Mms-Response-Status */ +#define MM_RTEXT_HDR 0x93 /* X-Mms-Response-Text */ +#define MM_SVISIBILITY_HDR 0x94 /* X-Mms-Sender-Visibility */ +#define MM_STATUS_HDR 0x95 /* X-Mms-Status */ +#define MM_SUBJECT_HDR 0x96 /* Subject */ +#define MM_TO_HDR 0x97 /* To */ +#define MM_TID_HDR 0x98 /* X-Mms-Transaction-Id */ /* MMS 1.1 */ -#define MM_RETRIEVE_STATUS_HDR 0x99 /* X-Mms-Retrieve-Status */ -#define MM_RETRIEVE_TEXT_HDR 0x9A /* X-Mms-Retrieve-Text */ -#define MM_READ_STATUS_HDR 0x9B /* X-Mms-Read-Status */ -#define MM_REPLY_CHARGING_HDR 0x9C /* X-Mms-Reply-Charging */ -#define MM_REPLY_CHARGING_DEADLINE_HDR \ - 0x9D /* X-Mms-Reply-Charging-Deadline*/ -#define MM_REPLY_CHARGING_ID_HDR \ - 0x9E /* X-Mms-Reply-Charging-ID */ -#define MM_REPLY_CHARGING_SIZE_HDR \ - 0x9F /* X-Mms-Reply-Charging-Size */ -#define MM_PREV_SENT_BY_HDR 0xA0 /* X-Mms-Previously-Sent-By */ -#define MM_PREV_SENT_DATE_HDR 0xA1 /* X-Mms-Previously-Sent-Date */ +#define MM_RETRIEVE_STATUS_HDR 0x99 /* X-Mms-Retrieve-Status */ +#define MM_RETRIEVE_TEXT_HDR 0x9A /* X-Mms-Retrieve-Text */ +#define MM_READ_STATUS_HDR 0x9B /* X-Mms-Read-Status */ +#define MM_REPLY_CHARGING_HDR 0x9C /* X-Mms-Reply-Charging */ +#define MM_REPLY_CHARGING_DEADLINE_HDR \ + 0x9D /* X-Mms-Reply-Charging-Deadline*/ +#define MM_REPLY_CHARGING_ID_HDR \ + 0x9E /* X-Mms-Reply-Charging-ID */ +#define MM_REPLY_CHARGING_SIZE_HDR \ + 0x9F /* X-Mms-Reply-Charging-Size */ +#define MM_PREV_SENT_BY_HDR 0xA0 /* X-Mms-Previously-Sent-By */ +#define MM_PREV_SENT_DATE_HDR 0xA1 /* X-Mms-Previously-Sent-Date */ /* MMS 1.2 */ -#define MM_STORE_HDR 0xA2 /* X-Mms-Store */ -#define MM_MM_STATE_HDR 0xA3 /* X-Mms-MM-State */ -#define MM_MM_FLAGS_HDR 0xA4 /* X-Mms-MM-Flags */ -#define MM_STORE_STATUS_HDR 0xA5 /* X-Mms-Store-Status */ -#define MM_STORE_STATUS_TEXT_HDR \ - 0xA6 /* X-Mms-Store-Status-Text */ -#define MM_STORED_HDR 0xA7 /* X-Mms-Stored */ -#define MM_ATTRIBUTES_HDR 0xA8 /* X-Mms-Attributes */ -#define MM_TOTALS_HDR 0xA9 /* X-Mms-Totals */ -#define MM_MBOX_TOTALS_HDR 0xAA /* X-Mms-Mbox-Totals */ -#define MM_QUOTAS_HDR 0xAB /* X-Mms-Quotas */ -#define MM_MBOX_QUOTAS_HDR 0xAC /* X-Mms-Mbox-Quotas */ -#define MM_MBOX_MSG_COUNT_HDR 0xAD /* X-Mms-Message-Count */ -#define MM_CONTENT_HDR 0xAE /* Content */ -#define MM_START_HDR 0xAF /* X-Mms-Start */ -#define MM_ADDITIONAL_HDR 0xB0 /* Additional-headers */ -#define MM_DISTRIBUION_IND_HDR 0xB1 /* X-Mms-Distribution-Indcator */ -#define MM_ELEMENT_DESCR_HDR 0xB2 /* X-Mms-Element-Descriptor */ -#define MM_LIMIT_HDR 0xB3 /* X-Mms-Limit */ +#define MM_STORE_HDR 0xA2 /* X-Mms-Store */ +#define MM_MM_STATE_HDR 0xA3 /* X-Mms-MM-State */ +#define MM_MM_FLAGS_HDR 0xA4 /* X-Mms-MM-Flags */ +#define MM_STORE_STATUS_HDR 0xA5 /* X-Mms-Store-Status */ +#define MM_STORE_STATUS_TEXT_HDR \ + 0xA6 /* X-Mms-Store-Status-Text */ +#define MM_STORED_HDR 0xA7 /* X-Mms-Stored */ +#define MM_ATTRIBUTES_HDR 0xA8 /* X-Mms-Attributes */ +#define MM_TOTALS_HDR 0xA9 /* X-Mms-Totals */ +#define MM_MBOX_TOTALS_HDR 0xAA /* X-Mms-Mbox-Totals */ +#define MM_QUOTAS_HDR 0xAB /* X-Mms-Quotas */ +#define MM_MBOX_QUOTAS_HDR 0xAC /* X-Mms-Mbox-Quotas */ +#define MM_MBOX_MSG_COUNT_HDR 0xAD /* X-Mms-Message-Count */ +#define MM_CONTENT_HDR 0xAE /* Content */ +#define MM_START_HDR 0xAF /* X-Mms-Start */ +#define MM_ADDITIONAL_HDR 0xB0 /* Additional-headers */ +#define MM_DISTRIBUION_IND_HDR 0xB1 /* X-Mms-Distribution-Indcator */ +#define MM_ELEMENT_DESCR_HDR 0xB2 /* X-Mms-Element-Descriptor */ +#define MM_LIMIT_HDR 0xB3 /* X-Mms-Limit */ static const value_string vals_mm_header_names[] = { - /* MMS 1.0 */ - { MM_BCC_HDR, "Bcc" }, - { MM_CC_HDR, "Cc" }, - { MM_CLOCATION_HDR, "X-Mms-Content-Location" }, - { MM_CTYPE_HDR, "X-Mms-Content-Type" }, - { MM_DATE_HDR, "Date" }, - { MM_DREPORT_HDR, "X-Mms-Delivery-Report" }, - { MM_DTIME_HDR, "X-Mms-Delivery-Time" }, - { MM_EXPIRY_HDR, "X-Mms-Expiry" }, - { MM_FROM_HDR, "From" }, - { MM_MCLASS_HDR, "X-Mms-Message-Class" }, - { MM_MID_HDR, "Message-ID" }, - { MM_MTYPE_HDR, "X-Mms-Message-Type" }, - { MM_VERSION_HDR, "X-Mms-MMS-Version" }, - { MM_MSIZE_HDR, "X-Mms-Message-Size" }, - { MM_PRIORITY_HDR, "X-Mms-Priority" }, - { MM_RREPLY_HDR, "X-Mms-Read-Reply" }, - { MM_RALLOWED_HDR, "X-Mms-Report-Allowed" }, - { MM_RSTATUS_HDR, "X-Mms-Response-Status" }, - { MM_RTEXT_HDR, "X-Mms-Response-Text" }, - { MM_SVISIBILITY_HDR, "X-Mms-Sender-Visibility" }, - { MM_STATUS_HDR, "X-Mms-Status" }, - { MM_SUBJECT_HDR, "Subject" }, - { MM_TO_HDR, "To" }, - { MM_TID_HDR, "X-Mms-Transaction-Id" }, - /* MMS 1.1 */ - { MM_RETRIEVE_STATUS_HDR, "X-Mms-Retrieve-Status" }, - { MM_RETRIEVE_TEXT_HDR, "X-Mms-Retrieve-Text" }, - { MM_READ_STATUS_HDR, "X-Mms-Read-Status" }, - { MM_REPLY_CHARGING_HDR, "X-Mms-Reply-Charging" }, - { MM_REPLY_CHARGING_DEADLINE_HDR, - "X-Mms-Reply-Charging-Deadline" }, - { MM_REPLY_CHARGING_ID_HDR, "X-Mms-Reply-Charging-ID" }, - { MM_REPLY_CHARGING_SIZE_HDR, "X-Mms-Reply-Charging-Size" }, - { MM_PREV_SENT_BY_HDR, "X-Mms-Previously-Sent-By" }, - { MM_PREV_SENT_DATE_HDR, "X-Mms-Previously-Sent-Date" }, - /* MMS 1.2 */ - { MM_STORE_HDR, "X-Mms-Store" }, - { MM_MM_STATE_HDR, "X-Mms-MM-State" }, - { MM_MM_FLAGS_HDR, "X-Mms-MM-Flags" }, - { MM_STORE_STATUS_HDR, "X-Mms-Store-Status" }, - { MM_STORE_STATUS_TEXT_HDR, "X-Mms-Store-Status-Text" }, - { MM_STORED_HDR, "X-Mms-Stored" }, - { MM_ATTRIBUTES_HDR, "X-Mms-Attributes" }, - { MM_TOTALS_HDR, "X-Mms-Totals" }, - { MM_MBOX_TOTALS_HDR, "X-Mms-Mbox-Totals" }, - { MM_QUOTAS_HDR, "X-Mms-Quotas" }, - { MM_MBOX_QUOTAS_HDR, "X-Mms-Mbox-Quotas" }, - { MM_MBOX_MSG_COUNT_HDR, "X-Mms-Message-Count" }, - { MM_CONTENT_HDR, "Content" }, - { MM_START_HDR, "X-Mms-Start" }, - { MM_ADDITIONAL_HDR, "Additional-headers" }, - { MM_DISTRIBUION_IND_HDR, "X-Mms-Distribution-Indcator" }, - { MM_ELEMENT_DESCR_HDR, "X-Mms-Element-Descriptor" }, - { MM_LIMIT_HDR, "X-Mms-Limit" }, - - { 0x00, NULL }, + /* MMS 1.0 */ + { MM_BCC_HDR, "Bcc" }, + { MM_CC_HDR, "Cc" }, + { MM_CLOCATION_HDR, "X-Mms-Content-Location" }, + { MM_CTYPE_HDR, "X-Mms-Content-Type" }, + { MM_DATE_HDR, "Date" }, + { MM_DREPORT_HDR, "X-Mms-Delivery-Report" }, + { MM_DTIME_HDR, "X-Mms-Delivery-Time" }, + { MM_EXPIRY_HDR, "X-Mms-Expiry" }, + { MM_FROM_HDR, "From" }, + { MM_MCLASS_HDR, "X-Mms-Message-Class" }, + { MM_MID_HDR, "Message-ID" }, + { MM_MTYPE_HDR, "X-Mms-Message-Type" }, + { MM_VERSION_HDR, "X-Mms-MMS-Version" }, + { MM_MSIZE_HDR, "X-Mms-Message-Size" }, + { MM_PRIORITY_HDR, "X-Mms-Priority" }, + { MM_RREPLY_HDR, "X-Mms-Read-Reply" }, + { MM_RALLOWED_HDR, "X-Mms-Report-Allowed" }, + { MM_RSTATUS_HDR, "X-Mms-Response-Status" }, + { MM_RTEXT_HDR, "X-Mms-Response-Text" }, + { MM_SVISIBILITY_HDR, "X-Mms-Sender-Visibility" }, + { MM_STATUS_HDR, "X-Mms-Status" }, + { MM_SUBJECT_HDR, "Subject" }, + { MM_TO_HDR, "To" }, + { MM_TID_HDR, "X-Mms-Transaction-Id" }, + /* MMS 1.1 */ + { MM_RETRIEVE_STATUS_HDR, "X-Mms-Retrieve-Status" }, + { MM_RETRIEVE_TEXT_HDR, "X-Mms-Retrieve-Text" }, + { MM_READ_STATUS_HDR, "X-Mms-Read-Status" }, + { MM_REPLY_CHARGING_HDR, "X-Mms-Reply-Charging" }, + { MM_REPLY_CHARGING_DEADLINE_HDR, + "X-Mms-Reply-Charging-Deadline" }, + { MM_REPLY_CHARGING_ID_HDR, "X-Mms-Reply-Charging-ID" }, + { MM_REPLY_CHARGING_SIZE_HDR, "X-Mms-Reply-Charging-Size" }, + { MM_PREV_SENT_BY_HDR, "X-Mms-Previously-Sent-By" }, + { MM_PREV_SENT_DATE_HDR, "X-Mms-Previously-Sent-Date" }, + /* MMS 1.2 */ + { MM_STORE_HDR, "X-Mms-Store" }, + { MM_MM_STATE_HDR, "X-Mms-MM-State" }, + { MM_MM_FLAGS_HDR, "X-Mms-MM-Flags" }, + { MM_STORE_STATUS_HDR, "X-Mms-Store-Status" }, + { MM_STORE_STATUS_TEXT_HDR, "X-Mms-Store-Status-Text" }, + { MM_STORED_HDR, "X-Mms-Stored" }, + { MM_ATTRIBUTES_HDR, "X-Mms-Attributes" }, + { MM_TOTALS_HDR, "X-Mms-Totals" }, + { MM_MBOX_TOTALS_HDR, "X-Mms-Mbox-Totals" }, + { MM_QUOTAS_HDR, "X-Mms-Quotas" }, + { MM_MBOX_QUOTAS_HDR, "X-Mms-Mbox-Quotas" }, + { MM_MBOX_MSG_COUNT_HDR, "X-Mms-Message-Count" }, + { MM_CONTENT_HDR, "Content" }, + { MM_START_HDR, "X-Mms-Start" }, + { MM_ADDITIONAL_HDR, "Additional-headers" }, + { MM_DISTRIBUION_IND_HDR, "X-Mms-Distribution-Indcator" }, + { MM_ELEMENT_DESCR_HDR, "X-Mms-Element-Descriptor" }, + { MM_LIMIT_HDR, "X-Mms-Limit" }, + + { 0x00, NULL }, }; /* * Initialize the protocol and registered fields */ static int proto_mmse = -1; -static int hf_mmse_message_type = -1; -static int hf_mmse_transaction_id = -1; -static int hf_mmse_mms_version = -1; -static int hf_mmse_bcc = -1; -static int hf_mmse_cc = -1; -static int hf_mmse_content_location = -1; -static int hf_mmse_date = -1; -static int hf_mmse_delivery_report = -1; -static int hf_mmse_delivery_time_abs = -1; -static int hf_mmse_delivery_time_rel = -1; -static int hf_mmse_expiry_abs = -1; -static int hf_mmse_expiry_rel = -1; -static int hf_mmse_from = -1; -static int hf_mmse_message_class_id = -1; -static int hf_mmse_message_class_str = -1; -static int hf_mmse_message_id = -1; -static int hf_mmse_message_size = -1; -static int hf_mmse_priority = -1; -static int hf_mmse_read_reply = -1; -static int hf_mmse_report_allowed = -1; -static int hf_mmse_response_status = -1; -static int hf_mmse_response_text = -1; -static int hf_mmse_sender_visibility = -1; -static int hf_mmse_status = -1; -static int hf_mmse_subject = -1; -static int hf_mmse_to = -1; -/* static int hf_mmse_content_type = -1; */ -static int hf_mmse_ffheader = -1; +static int hf_mmse_message_type = -1; +static int hf_mmse_transaction_id = -1; +static int hf_mmse_mms_version = -1; +static int hf_mmse_bcc = -1; +static int hf_mmse_cc = -1; +static int hf_mmse_content_location = -1; +static int hf_mmse_date = -1; +static int hf_mmse_delivery_report = -1; +static int hf_mmse_delivery_time_abs = -1; +static int hf_mmse_delivery_time_rel = -1; +static int hf_mmse_expiry_abs = -1; +static int hf_mmse_expiry_rel = -1; +static int hf_mmse_from = -1; +static int hf_mmse_message_class_id = -1; +static int hf_mmse_message_class_str = -1; +static int hf_mmse_message_id = -1; +static int hf_mmse_message_size = -1; +static int hf_mmse_priority = -1; +static int hf_mmse_read_reply = -1; +static int hf_mmse_report_allowed = -1; +static int hf_mmse_response_status = -1; +static int hf_mmse_response_text = -1; +static int hf_mmse_sender_visibility = -1; +static int hf_mmse_status = -1; +static int hf_mmse_subject = -1; +static int hf_mmse_to = -1; +/* static int hf_mmse_content_type = -1; */ +static int hf_mmse_ffheader = -1; /* MMSE 1.1 */ -static int hf_mmse_read_report = -1; -static int hf_mmse_retrieve_status = -1; -static int hf_mmse_retrieve_text = -1; -static int hf_mmse_read_status = -1; -static int hf_mmse_reply_charging = -1; -static int hf_mmse_reply_charging_deadline_abs = -1; -static int hf_mmse_reply_charging_deadline_rel = -1; -static int hf_mmse_reply_charging_id = -1; -static int hf_mmse_reply_charging_size = -1; -static int hf_mmse_prev_sent_by = -1; -static int hf_mmse_prev_sent_by_fwd_count = -1; -static int hf_mmse_prev_sent_by_address = -1; -static int hf_mmse_prev_sent_date = -1; -static int hf_mmse_prev_sent_date_fwd_count = -1; -static int hf_mmse_prev_sent_date_date = -1; +static int hf_mmse_read_report = -1; +static int hf_mmse_retrieve_status = -1; +static int hf_mmse_retrieve_text = -1; +static int hf_mmse_read_status = -1; +static int hf_mmse_reply_charging = -1; +static int hf_mmse_reply_charging_deadline_abs = -1; +static int hf_mmse_reply_charging_deadline_rel = -1; +static int hf_mmse_reply_charging_id = -1; +static int hf_mmse_reply_charging_size = -1; +static int hf_mmse_prev_sent_by = -1; +static int hf_mmse_prev_sent_by_fwd_count = -1; +static int hf_mmse_prev_sent_by_address = -1; +static int hf_mmse_prev_sent_date = -1; +static int hf_mmse_prev_sent_date_fwd_count = -1; +static int hf_mmse_prev_sent_date_date = -1; static int hf_mmse_header_uint = -1; static int hf_mmse_header_string = -1; static int hf_mmse_header_bytes = -1; @@ -249,69 +249,69 @@ static int hf_mmse_header_bytes = -1; /* * Initialize the subtree pointers */ -static gint ett_mmse = -1; -static gint ett_mmse_hdr_details = -1; +static gint ett_mmse = -1; +static gint ett_mmse_hdr_details = -1; /* * Valuestrings for PDU types */ /* MMS 1.0 */ -#define PDU_M_SEND_REQ 0x80 -#define PDU_M_SEND_CONF 0x81 -#define PDU_M_NOTIFICATION_IND 0x82 -#define PDU_M_NOTIFYRESP_IND 0x83 -#define PDU_M_RETRIEVE_CONF 0x84 -#define PDU_M_ACKNOWLEDGE_IND 0x85 -#define PDU_M_DELIVERY_IND 0x86 +#define PDU_M_SEND_REQ 0x80 +#define PDU_M_SEND_CONF 0x81 +#define PDU_M_NOTIFICATION_IND 0x82 +#define PDU_M_NOTIFYRESP_IND 0x83 +#define PDU_M_RETRIEVE_CONF 0x84 +#define PDU_M_ACKNOWLEDGE_IND 0x85 +#define PDU_M_DELIVERY_IND 0x86 /* MMS 1.1 */ -#define PDU_M_READ_REC_IND 0x87 -#define PDU_M_READ_ORIG_IND 0x88 -#define PDU_M_FORWARD_REQ 0x89 -#define PDU_M_FORWARD_CONF 0x8A +#define PDU_M_READ_REC_IND 0x87 +#define PDU_M_READ_ORIG_IND 0x88 +#define PDU_M_FORWARD_REQ 0x89 +#define PDU_M_FORWARD_CONF 0x8A /* MMS 1.2 */ -#define PDU_M_MBOX_STORE_REQ 0x8B -#define PDU_M_MBOX_STORE_CONF 0x8C -#define PDU_M_MBOX_VIEW_REQ 0x8D -#define PDU_M_MBOX_VIEW_CONF 0x8E -#define PDU_M_MBOX_UPLOAD_REQ 0x8F -#define PDU_M_MBOX_UPLOAD_CONF 0x90 -#define PDU_M_MBOX_DELETE_REQ 0x91 -#define PDU_M_MBOX_DELETE_CONF 0x92 -#define PDU_M_MBOX_DESCR 0x93 +#define PDU_M_MBOX_STORE_REQ 0x8B +#define PDU_M_MBOX_STORE_CONF 0x8C +#define PDU_M_MBOX_VIEW_REQ 0x8D +#define PDU_M_MBOX_VIEW_CONF 0x8E +#define PDU_M_MBOX_UPLOAD_REQ 0x8F +#define PDU_M_MBOX_UPLOAD_CONF 0x90 +#define PDU_M_MBOX_DELETE_REQ 0x91 +#define PDU_M_MBOX_DELETE_CONF 0x92 +#define PDU_M_MBOX_DESCR 0x93 #define pdu_has_content(pdut) \ - ( ((pdut) == PDU_M_SEND_REQ) \ - || ((pdut) == PDU_M_DELIVERY_IND) \ - || ((pdut) == PDU_M_RETRIEVE_CONF) \ - || ((pdut) == PDU_M_MBOX_VIEW_CONF) \ - || ((pdut) == PDU_M_MBOX_DESCR) \ - || ((pdut) == PDU_M_MBOX_UPLOAD_REQ) \ - ) + ( ((pdut) == PDU_M_SEND_REQ) \ + || ((pdut) == PDU_M_DELIVERY_IND) \ + || ((pdut) == PDU_M_RETRIEVE_CONF) \ + || ((pdut) == PDU_M_MBOX_VIEW_CONF) \ + || ((pdut) == PDU_M_MBOX_DESCR) \ + || ((pdut) == PDU_M_MBOX_UPLOAD_REQ) \ + ) static const value_string vals_message_type[] = { /* MMS 1.0 */ - { PDU_M_SEND_REQ, "m-send-req" }, - { PDU_M_SEND_CONF, "m-send-conf" }, - { PDU_M_NOTIFICATION_IND, "m-notification-ind" }, - { PDU_M_NOTIFYRESP_IND, "m-notifyresp-ind" }, - { PDU_M_RETRIEVE_CONF, "m-retrieve-conf" }, - { PDU_M_ACKNOWLEDGE_IND, "m-acknowledge-ind" }, - { PDU_M_DELIVERY_IND, "m-delivery-ind" }, + { PDU_M_SEND_REQ, "m-send-req" }, + { PDU_M_SEND_CONF, "m-send-conf" }, + { PDU_M_NOTIFICATION_IND, "m-notification-ind" }, + { PDU_M_NOTIFYRESP_IND, "m-notifyresp-ind" }, + { PDU_M_RETRIEVE_CONF, "m-retrieve-conf" }, + { PDU_M_ACKNOWLEDGE_IND, "m-acknowledge-ind" }, + { PDU_M_DELIVERY_IND, "m-delivery-ind" }, /* MMS 1.1 */ - { PDU_M_READ_REC_IND, "m-read-rec-ind" }, - { PDU_M_READ_ORIG_IND, "m-read-orig-ind" }, - { PDU_M_FORWARD_REQ, "m-forward-req" }, - { PDU_M_FORWARD_CONF, "m-forward-conf" }, + { PDU_M_READ_REC_IND, "m-read-rec-ind" }, + { PDU_M_READ_ORIG_IND, "m-read-orig-ind" }, + { PDU_M_FORWARD_REQ, "m-forward-req" }, + { PDU_M_FORWARD_CONF, "m-forward-conf" }, /* MMS 1.2 */ - { PDU_M_MBOX_STORE_REQ, "m-mbox-store-req" }, - { PDU_M_MBOX_STORE_CONF, "m-mbox-store-conf" }, - { PDU_M_MBOX_VIEW_REQ, "m-mbox-view-req" }, - { PDU_M_MBOX_VIEW_CONF, "m-mbox-view-conf" }, - { PDU_M_MBOX_UPLOAD_REQ, "m-mbox-upload-req" }, - { PDU_M_MBOX_UPLOAD_CONF, "m-mbox-upload-conf" }, - { PDU_M_MBOX_DELETE_REQ, "m-mbox-delete-req" }, - { PDU_M_MBOX_DELETE_CONF, "m-mbox-delete-conf" }, - { PDU_M_MBOX_DESCR, "m-mbox-descr" }, + { PDU_M_MBOX_STORE_REQ, "m-mbox-store-req" }, + { PDU_M_MBOX_STORE_CONF, "m-mbox-store-conf" }, + { PDU_M_MBOX_VIEW_REQ, "m-mbox-view-req" }, + { PDU_M_MBOX_VIEW_CONF, "m-mbox-view-conf" }, + { PDU_M_MBOX_UPLOAD_REQ, "m-mbox-upload-req" }, + { PDU_M_MBOX_UPLOAD_CONF, "m-mbox-upload-conf" }, + { PDU_M_MBOX_DELETE_REQ, "m-mbox-delete-req" }, + { PDU_M_MBOX_DELETE_CONF, "m-mbox-delete-conf" }, + { PDU_M_MBOX_DESCR, "m-mbox-descr" }, { 0x00, NULL }, }; @@ -440,140 +440,140 @@ static const value_string vals_reply_charging[] = { /*! * Decodes a Text-string from the protocol data - * Text-string = [Quote] *TEXT End-of-string - * Quote = <Octet 127> - * End-of-string = <Octet 0> + * Text-string = [Quote] *TEXT End-of-string + * Quote = <Octet 127> + * End-of-string = <Octet 0> * * \todo Shouldn't we be sharing this with WSP (packet-wap.c)? * - * \param tvb The buffer with PDU-data - * \param offset Offset within that buffer - * \param strval Pointer to variable into which to put pointer to - * buffer allocated to hold the text; must be freed - * when no longer used + * \param tvb The buffer with PDU-data + * \param offset Offset within that buffer + * \param strval Pointer to variable into which to put pointer to + * buffer allocated to hold the text; must be freed + * when no longer used * - * \return The length in bytes of the entire field + * \return The length in bytes of the entire field */ static guint get_text_string(tvbuff_t *tvb, guint offset, const char **strval) { - guint len; + guint len; DebugLog(("get_text_string(tvb = %p, offset = %u, **strval) - start\n", - tvb, offset)); + tvb, offset)); len = tvb_strsize(tvb, offset); DebugLog((" [1] tvb_strsize(tvb, offset) == %u\n", len)); if (tvb_get_guint8(tvb, offset) == MM_QUOTE) - *strval = (const char *)tvb_memdup(wmem_packet_scope(), tvb, offset+1, len-1); + *strval = (const char *)tvb_memdup(wmem_packet_scope(), tvb, offset+1, len-1); else - *strval = (const char *)tvb_memdup(wmem_packet_scope(), tvb, offset, len); + *strval = (const char *)tvb_memdup(wmem_packet_scope(), tvb, offset, len); DebugLog((" [3] Return(len) == %u\n", len)); return len; } /*! * Decodes a Value-length from the protocol data. - * Value-length = Short-length | (Length-quote Length) - * Short-length = <Any octet 0-30> - * Length-quote = <Octet 31> - * Length = Uintvar-integer + * Value-length = Short-length | (Length-quote Length) + * Short-length = <Any octet 0-30> + * Length-quote = <Octet 31> + * Length = Uintvar-integer * * \todo Shouldn't we be sharing this with WSP (packet-wap.c)? * - * \param tvb The buffer with PDU-data - * \param offset Offset within that buffer - * \param byte_count Returns the length in bytes of - * the "Value-length" field. + * \param tvb The buffer with PDU-data + * \param offset Offset within that buffer + * \param byte_count Returns the length in bytes of + * the "Value-length" field. * - * \return The actual value of "Value-length" + * \return The actual value of "Value-length" */ static guint get_value_length(tvbuff_t *tvb, guint offset, guint *byte_count) { - guint field; + guint field; field = tvb_get_guint8(tvb, offset++); if (field < 31) - *byte_count = 1; - else { /* Must be 31 so, Uintvar follows */ - field = tvb_get_guintvar(tvb, offset, byte_count); - (*byte_count)++; + *byte_count = 1; + else { /* Must be 31 so, Uintvar follows */ + field = tvb_get_guintvar(tvb, offset, byte_count); + (*byte_count)++; } return field; } /*! * Decodes an Encoded-string-value from the protocol data - * Encoded-string-value = Text-string | Value-length Char-set Text-string + * Encoded-string-value = Text-string | Value-length Char-set Text-string * - * \param tvb The buffer with PDU-data - * \param offset Offset within that buffer - * \param strval Pointer to variable into which to put pointer to - * buffer allocated to hold the text; must be freed - * when no longer used + * \param tvb The buffer with PDU-data + * \param offset Offset within that buffer + * \param strval Pointer to variable into which to put pointer to + * buffer allocated to hold the text; must be freed + * when no longer used * - * \return The length in bytes of the entire field + * \return The length in bytes of the entire field */ static guint get_encoded_strval(tvbuff_t *tvb, guint offset, const char **strval) { - guint field; - guint length; - guint count; + guint field; + guint length; + guint count; field = tvb_get_guint8(tvb, offset); if (field < 32) { - length = get_value_length(tvb, offset, &count); - if (length < 2) { - *strval = ""; - } else { - /* \todo Something with "Char-set", skip for now */ - *strval = (char *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset + count + 1, length - 1, ENC_ASCII); - } - return count + length; + length = get_value_length(tvb, offset, &count); + if (length < 2) { + *strval = ""; + } else { + /* \todo Something with "Char-set", skip for now */ + *strval = (char *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset + count + 1, length - 1, ENC_ASCII); + } + return count + length; } else - return get_text_string(tvb, offset, strval); + return get_text_string(tvb, offset, strval); } /*! * Decodes a Long-integer from the protocol data - * Long-integer = Short-length Multi-octet-integer - * Short-length = <Any octet 0-30> - * Multi-octet-integer = 1*30OCTET + * Long-integer = Short-length Multi-octet-integer + * Short-length = <Any octet 0-30> + * Multi-octet-integer = 1*30OCTET * * \todo Shouldn't we be sharing this with WSP (packet-wap.c)? * - * \param tvb The buffer with PDU-data - * \param offset Offset within that buffer - * \param byte_count Returns the length in bytes of the field + * \param tvb The buffer with PDU-data + * \param offset Offset within that buffer + * \param byte_count Returns the length in bytes of the field * - * \return The value of the Long-integer + * \return The value of the Long-integer * - * \note A maximum of 4-byte integers will be handled. + * \note A maximum of 4-byte integers will be handled. */ static guint get_long_integer(tvbuff_t *tvb, guint offset, guint *byte_count) { - guint val; + guint val; *byte_count = tvb_get_guint8(tvb, offset++); switch (*byte_count) { - case 1: - val = tvb_get_guint8(tvb, offset); - break; - case 2: - val = tvb_get_ntohs(tvb, offset); - break; - case 3: - val = tvb_get_ntoh24(tvb, offset); - break; - case 4: - val = tvb_get_ntohl(tvb, offset); - break; - default: - val = 0; - break; + case 1: + val = tvb_get_guint8(tvb, offset); + break; + case 2: + val = tvb_get_ntohs(tvb, offset); + break; + case 3: + val = tvb_get_ntoh24(tvb, offset); + break; + case 4: + val = tvb_get_ntohl(tvb, offset); + break; + default: + val = 0; + break; } (*byte_count)++; return val; @@ -581,52 +581,52 @@ get_long_integer(tvbuff_t *tvb, guint offset, guint *byte_count) /*! * Decodes an Integer-value from the protocol data - * Integer-value = Short-integer | Long-integer - * Short-integer = OCTET - * Long-integer = Short-length Multi-octet-integer - * Short-length = <Any octet 0-30> - * Multi-octet-integer = 1*30OCTET + * Integer-value = Short-integer | Long-integer + * Short-integer = OCTET + * Long-integer = Short-length Multi-octet-integer + * Short-length = <Any octet 0-30> + * Multi-octet-integer = 1*30OCTET * * \todo Shouldn't we be sharing this with WSP (packet-wap.c)? * - * \param tvb The buffer with PDU-data - * \param offset Offset within that buffer - * \param byte_count Returns the length in bytes of the field + * \param tvb The buffer with PDU-data + * \param offset Offset within that buffer + * \param byte_count Returns the length in bytes of the field * - * \return The value of the Long-integer + * \return The value of the Long-integer * - * \note A maximum of 4-byte integers will be handled. + * \note A maximum of 4-byte integers will be handled. */ static guint get_integer_value(tvbuff_t *tvb, guint offset, guint *byte_count) { - guint val; + guint val; guint8 peek; peek = tvb_get_guint8(tvb, offset++); if (peek & 0x80) { - val = peek & 0x7F; - *byte_count = 1; - return val; + val = peek & 0x7F; + *byte_count = 1; + return val; } else { - *byte_count = peek; - switch (peek) { - case 1: - val = tvb_get_guint8(tvb, offset); - break; - case 2: - val = tvb_get_ntohs(tvb, offset); - break; - case 3: - val = tvb_get_ntoh24(tvb, offset); - break; - case 4: - val = tvb_get_ntohl(tvb, offset); - break; - default: - val = 0; - break; - } + *byte_count = peek; + switch (peek) { + case 1: + val = tvb_get_guint8(tvb, offset); + break; + case 2: + val = tvb_get_ntohs(tvb, offset); + break; + case 3: + val = tvb_get_ntoh24(tvb, offset); + break; + case 4: + val = tvb_get_ntohl(tvb, offset); + break; + default: + val = 0; + break; + } } (*byte_count)++; return val; @@ -636,22 +636,22 @@ get_integer_value(tvbuff_t *tvb, guint offset, guint *byte_count) static gboolean dissect_mmse_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - guint8 pdut; + guint8 pdut; - DebugLog(("dissect_mmse_heur()\n")); + DebugLog(("dissect_mmse_heur()\n")); /* * Check if data makes sense for it to be dissected as MMSE: Message-type * field must make sense and followed by either Transaction-Id * or MMS-Version header */ if (tvb_get_guint8(tvb, 0) != MM_MTYPE_HDR) - return FALSE; + return FALSE; pdut = tvb_get_guint8(tvb, 1); if (try_val_to_str(pdut, vals_message_type) == NULL) - return FALSE; + return FALSE; if ((tvb_get_guint8(tvb, 2) != MM_TID_HDR) && - (tvb_get_guint8(tvb, 2) != MM_VERSION_HDR)) - return FALSE; + (tvb_get_guint8(tvb, 2) != MM_VERSION_HDR)) + return FALSE; dissect_mmse_standalone(tvb, pinfo, tree); return TRUE; } @@ -659,11 +659,11 @@ dissect_mmse_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat static void dissect_mmse_standalone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - guint8 pdut; - const char *message_type; + guint8 pdut; + const char *message_type; DebugLog(("dissect_mmse_standalone() - START (Packet %u)\n", - pinfo->fd->num)); + pinfo->fd->num)); pdut = tvb_get_guint8(tvb, 1); message_type = val_to_str(pdut, vals_message_type, "Unknown type %u"); @@ -671,7 +671,7 @@ dissect_mmse_standalone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MMSE"); - col_add_fstr(pinfo->cinfo, COL_INFO, "MMS %s", message_type); + col_add_fstr(pinfo->cinfo, COL_INFO, "MMS %s", message_type); dissect_mmse(tvb, pinfo, tree, pdut, message_type); } @@ -679,36 +679,36 @@ dissect_mmse_standalone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_mmse_encapsulated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - guint8 pdut; - const char *message_type; + guint8 pdut; + const char *message_type; DebugLog(("dissect_mmse_encapsulated() - START (Packet %u)\n", - pinfo->fd->num)); + pinfo->fd->num)); pdut = tvb_get_guint8(tvb, 1); message_type = val_to_str(pdut, vals_message_type, "Unknown type %u"); /* Make entries in Info column on summary display */ - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "(MMS %s)", - message_type); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "(MMS %s)", + message_type); dissect_mmse(tvb, pinfo, tree, pdut, message_type); } static void dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, - const char *message_type) + const char *message_type) { - guint offset; - guint8 field = 0; - const char *strval; - guint length; - guint count; - guint8 version = 0x80; /* Default to MMSE 1.0 */ + guint offset; + guint8 field = 0; + const char *strval; + guint length; + guint count; + guint8 version = 0x80; /* Default to MMSE 1.0 */ /* Set up structures needed to add the protocol subtree and manage it */ - proto_item *ti = NULL; - proto_tree *mmse_tree = NULL; + proto_item *ti = NULL; + proto_tree *mmse_tree = NULL; DebugLog(("dissect_mmse() - START (Packet %u)\n", pinfo->fd->num)); @@ -722,18 +722,18 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, * if tree is NULL. */ if (tree) { - DebugLog(("tree != NULL\n")); + DebugLog(("tree != NULL\n")); - ti = proto_tree_add_item(tree, proto_mmse, tvb, 0, -1, ENC_NA); - proto_item_append_text(ti, ", Type: %s", message_type); - /* create display subtree for the protocol */ - mmse_tree = proto_item_add_subtree(ti, ett_mmse); + ti = proto_tree_add_item(tree, proto_mmse, tvb, 0, -1, ENC_NA); + proto_item_append_text(ti, ", Type: %s", message_type); + /* create display subtree for the protocol */ + mmse_tree = proto_item_add_subtree(ti, ett_mmse); - /* Report PDU-type */ - proto_tree_add_uint(mmse_tree, hf_mmse_message_type, tvb, 0, 2, pdut); + /* Report PDU-type */ + proto_tree_add_uint(mmse_tree, hf_mmse_message_type, tvb, 0, 2, pdut); } - offset = 2; /* Skip Message-Type */ + offset = 2; /* Skip Message-Type */ /* * Cycle through MMS-headers @@ -742,579 +742,579 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, * to subdissectors. */ if (tree || pdu_has_content(pdut)) { - while ((offset < tvb_reported_length(tvb)) && - (field = tvb_get_guint8(tvb, offset++)) != MM_CTYPE_HDR) - { - DebugLog(("\tField = 0x%02X (offset = %u): %s\n", - field, offset, - val_to_str(field, vals_mm_header_names, - "Unknown MMS header 0x%02X"))); - switch (field) - { - case MM_TID_HDR: /* Text-string */ - length = get_text_string(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, hf_mmse_transaction_id, - tvb, offset - 1, length + 1,strval); - } - offset += length; - break; - case MM_VERSION_HDR: /* nibble-Major/nibble-minor*/ - version = tvb_get_guint8(tvb, offset++); - if (tree) { - guint8 major, minor; - char *vers_string; - - major = (version & 0x70) >> 4; - minor = version & 0x0F; - if (minor == 0x0F) - vers_string = wmem_strdup_printf(wmem_packet_scope(), "%u", major); - else - vers_string = wmem_strdup_printf(wmem_packet_scope(), "%u.%u", major, minor); - proto_tree_add_string(mmse_tree, hf_mmse_mms_version, - tvb, offset - 2, 2, vers_string); - } - break; - case MM_BCC_HDR: /* Encoded-string-value */ - length = get_encoded_strval(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, hf_mmse_bcc, tvb, - offset - 1, length + 1, strval); - } - offset += length; - break; - case MM_CC_HDR: /* Encoded-string-value */ - length = get_encoded_strval(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, hf_mmse_cc, tvb, - offset - 1, length + 1, strval); - } - offset += length; - break; - case MM_CLOCATION_HDR: /* Uri-value */ - if (pdut == PDU_M_MBOX_DELETE_CONF) { - /* General form with length */ - length = tvb_get_guint8(tvb, offset); - if (length == 0x1F) { - guint length_len = 0; - length = tvb_get_guintvar(tvb, offset + 1, - &length_len); - length += 1 + length_len; - } else { - length += 1; - } - if (tree) { - tvb_ensure_bytes_exist(tvb, offset - 1, length + 1); - proto_tree_add_string(mmse_tree, - hf_mmse_content_location, - tvb, offset - 1, length + 1, - "<Undecoded value for m-mbox-delete-conf>"); - } - } else { - length = get_text_string(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, - hf_mmse_content_location, - tvb, offset - 1, length + 1, strval); - } - } - offset += length; - break; - case MM_DATE_HDR: /* Long-integer */ - { - guint tval; - nstime_t tmptime; - - tval = get_long_integer(tvb, offset, &count); - tmptime.secs = tval; - tmptime.nsecs = 0; - if (tree) { - tvb_ensure_bytes_exist(tvb, offset - 1, count + 1); - proto_tree_add_time(mmse_tree, hf_mmse_date, tvb, - offset - 1, count + 1, &tmptime); - } - } - offset += count; - break; - case MM_DREPORT_HDR: /* Yes|No */ - field = tvb_get_guint8(tvb, offset++); - if (tree) { - proto_tree_add_uint(mmse_tree, - hf_mmse_delivery_report, - tvb, offset - 2, 2, field); - } - break; - case MM_DTIME_HDR: - /* - * Value-length(Absolute-token Date-value| - * Relative-token Delta-seconds-value) - */ - length = get_value_length(tvb, offset, &count); - field = tvb_get_guint8(tvb, offset + count); - if (tree) { - guint tval; - nstime_t tmptime; - guint cnt; - - tval = get_long_integer(tvb, offset + count + 1, &cnt); - tmptime.secs = tval; - tmptime.nsecs = 0; - - tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); - if (field == 0x80) - proto_tree_add_time(mmse_tree, - hf_mmse_delivery_time_abs, - tvb, offset - 1, - length + count + 1, &tmptime); - else - proto_tree_add_time(mmse_tree, - hf_mmse_delivery_time_rel, - tvb, offset - 1, - length + count + 1, &tmptime); - } - offset += length + count; - break; - case MM_EXPIRY_HDR: - /* - * Value-length(Absolute-token Date-value| - * Relative-token Delta-seconds-value) - */ - length = get_value_length(tvb, offset, &count); - field = tvb_get_guint8(tvb, offset + count); - if (tree) { - guint tval; - nstime_t tmptime; - guint cnt; - - tval = get_long_integer(tvb, offset + count + 1, &cnt); - tmptime.secs = tval; - tmptime.nsecs = 0; - - tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); - if (field == 0x80) - proto_tree_add_time(mmse_tree, hf_mmse_expiry_abs, - tvb, offset - 1, - length + count + 1, &tmptime); - else - proto_tree_add_time(mmse_tree, hf_mmse_expiry_rel, - tvb, offset - 1, - length + count + 1, &tmptime); - } - offset += length + count; - break; - case MM_FROM_HDR: - /* - * Value-length(Address-present-token Encoded-string-value - * |Insert-address-token) - */ - length = get_value_length(tvb, offset, &count); - if (tree) { - field = tvb_get_guint8(tvb, offset + count); - tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); - if (field == 0x81) { - proto_tree_add_string(mmse_tree, hf_mmse_from, tvb, - offset-1, length + count + 1, - "<insert address>"); - } else { - (void) get_encoded_strval(tvb, offset + count + 1, - &strval); - proto_tree_add_string(mmse_tree, hf_mmse_from, tvb, - offset-1, length + count + 1, strval); - } - } - offset += length + count; - break; - case MM_MCLASS_HDR: - /* - * Class-identifier|Text-string - */ - field = tvb_get_guint8(tvb, offset); - if (field & 0x80) { - offset++; - if (tree) { - proto_tree_add_uint(mmse_tree, - hf_mmse_message_class_id, - tvb, offset - 2, 2, field); - } - } else { - length = get_text_string(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, - hf_mmse_message_class_str, - tvb, offset - 1, length + 1, - strval); - } - offset += length; - } - break; - case MM_MID_HDR: /* Text-string */ - length = get_text_string(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, hf_mmse_message_id, - tvb, offset - 1, length + 1, strval); - } - offset += length; - break; - case MM_MSIZE_HDR: /* Long-integer */ - length = get_long_integer(tvb, offset, &count); - if (tree) { - proto_tree_add_uint(mmse_tree, hf_mmse_message_size, - tvb, offset - 1, count + 1, length); - } - offset += count; - break; - case MM_PRIORITY_HDR: /* Low|Normal|High */ - field = tvb_get_guint8(tvb, offset++); - if (tree) { - proto_tree_add_uint(mmse_tree, hf_mmse_priority, tvb, - offset - 2, 2, field); - } - break; - case MM_RREPLY_HDR: /* Yes|No */ - field = tvb_get_guint8(tvb, offset++); - if (tree) { - if (version == 0x80) { /* MMSE 1.0 */ - proto_tree_add_uint(mmse_tree, hf_mmse_read_reply, - tvb, offset - 2, 2, field); - } else { - proto_tree_add_uint(mmse_tree, hf_mmse_read_report, - tvb, offset - 2, 2, field); - } - } - break; - case MM_RALLOWED_HDR: /* Yes|No */ - field = tvb_get_guint8(tvb, offset++); - if (tree) { - proto_tree_add_uint(mmse_tree, hf_mmse_report_allowed, - tvb, offset - 2, 2, field); - } - break; - case MM_RSTATUS_HDR: - field = tvb_get_guint8(tvb, offset++); - if (tree) { - proto_tree_add_uint(mmse_tree, hf_mmse_response_status, - tvb, offset - 2, 2, field); - } - break; - case MM_RTEXT_HDR: /* Encoded-string-value */ - if (pdut == PDU_M_MBOX_DELETE_CONF) { - /* General form with length */ - length = tvb_get_guint8(tvb, offset); - if (length == 0x1F) { - guint length_len = 0; - length = tvb_get_guintvar(tvb, offset + 1, - &length_len); - length += 1 + length_len; - } else { - length += 1; - } - if (tree) { - proto_tree_add_string(mmse_tree, - hf_mmse_content_location, - tvb, offset - 1, length + 1, - "<Undecoded value for m-mbox-delete-conf>"); - } - } else { - length = get_encoded_strval(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, - hf_mmse_response_text, tvb, offset - 1, - length + 1, strval); - } - } - offset += length; - break; - case MM_SVISIBILITY_HDR: /* Hide|Show */ - field = tvb_get_guint8(tvb, offset++); - if (tree) { - proto_tree_add_uint(mmse_tree,hf_mmse_sender_visibility, - tvb, offset - 2, 2, field); - } - break; - case MM_STATUS_HDR: - field = tvb_get_guint8(tvb, offset++); - if (tree) { - proto_tree_add_uint(mmse_tree, hf_mmse_status, tvb, - offset - 2, 2, field); - } - break; - case MM_SUBJECT_HDR: /* Encoded-string-value */ - length = get_encoded_strval(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, hf_mmse_subject, tvb, - offset - 1, length + 1, strval); - } - offset += length; - break; - case MM_TO_HDR: /* Encoded-string-value */ - length = get_encoded_strval(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, hf_mmse_to, tvb, - offset - 1, length + 1, strval); - } - offset += length; - break; - - /* - * MMS Encapsulation 1.1 - */ - case MM_RETRIEVE_STATUS_HDR: /* Well-known-value */ - field = tvb_get_guint8(tvb, offset++); - if (tree) { - proto_tree_add_uint(mmse_tree, hf_mmse_retrieve_status, - tvb, offset - 2, 2, field); - } - break; - case MM_RETRIEVE_TEXT_HDR: - if (pdut == PDU_M_MBOX_DELETE_CONF) { - /* General form with length */ - length = tvb_get_guint8(tvb, offset); - if (length == 0x1F) { - guint length_len = 0; - length = tvb_get_guintvar(tvb, offset + 1, - &length_len); - length += 1 + length_len; - } else { - length += 1; - } - if (tree) { - proto_tree_add_string(mmse_tree, - hf_mmse_content_location, - tvb, offset - 1, length + 1, - "<Undecoded value for m-mbox-delete-conf>"); - } - } else { - /* Encoded-string-value */ - length = get_encoded_strval(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, - hf_mmse_retrieve_text, tvb, offset - 1, - length + 1, strval); - } - } - offset += length; - break; - case MM_READ_STATUS_HDR: /* Well-known-value */ - field = tvb_get_guint8(tvb, offset++); - if (tree) { - proto_tree_add_uint(mmse_tree, hf_mmse_read_status, - tvb, offset - 2, 2, field); - } - break; - case MM_REPLY_CHARGING_HDR: /* Well-known-value */ - field = tvb_get_guint8(tvb, offset++); - if (tree) { - proto_tree_add_uint(mmse_tree, hf_mmse_reply_charging, - tvb, offset - 2, 2, field); - } - break; - case MM_REPLY_CHARGING_DEADLINE_HDR: /* Well-known-value */ - /* - * Value-length(Absolute-token Date-value| - * Relative-token Delta-seconds-value) - */ - length = get_value_length(tvb, offset, &count); - field = tvb_get_guint8(tvb, offset + count); - if (tree) { - guint tval; - nstime_t tmptime; - guint cnt; - - tval = get_long_integer(tvb, offset + count + 1, &cnt); - tmptime.secs = tval; - tmptime.nsecs = 0; - - tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); - if (field == 0x80) - proto_tree_add_time(mmse_tree, hf_mmse_reply_charging_deadline_abs, - tvb, offset - 1, - length + count + 1, &tmptime); - else - proto_tree_add_time(mmse_tree, hf_mmse_reply_charging_deadline_rel, - tvb, offset - 1, - length + count + 1, &tmptime); - } - offset += length + count; - break; - case MM_REPLY_CHARGING_ID_HDR: /* Text-string */ - length = get_text_string(tvb, offset, &strval); - if (tree) { - proto_tree_add_string(mmse_tree, - hf_mmse_reply_charging_id, - tvb, offset - 1, length + 1, strval); - } - offset += length; - break; - case MM_REPLY_CHARGING_SIZE_HDR: /* Long-integer */ - length = get_long_integer(tvb, offset, &count); - if (tree) { - proto_tree_add_uint(mmse_tree, - hf_mmse_reply_charging_size, - tvb, offset - 1, count + 1, length); - } - offset += count; - break; - case MM_PREV_SENT_BY_HDR: - /* Value-length Integer-value Encoded-string-value */ - length = get_value_length(tvb, offset, &count); - if (tree) { - guint32 fwd_count, count1, count2; - proto_tree *subtree = NULL; - proto_item *tii = NULL; - /* 1. Forwarded-count-value := Integer-value */ - fwd_count = get_integer_value(tvb, offset + count, - &count1); - /* 2. Encoded-string-value */ - count2 = get_encoded_strval(tvb, - offset + count + count1, &strval); - /* Now render the fields */ - tii = proto_tree_add_string_format(mmse_tree, - hf_mmse_prev_sent_by, - tvb, offset - 1, 1 + count + length, - strval, "%s (Forwarded-count=%u)", - format_text(strval, strlen(strval)), - fwd_count); - subtree = proto_item_add_subtree(tii, - ett_mmse_hdr_details); - proto_tree_add_uint(subtree, - hf_mmse_prev_sent_by_fwd_count, - tvb, offset + count, count1, fwd_count); - proto_tree_add_string(subtree, - hf_mmse_prev_sent_by_address, - tvb, offset + count + count1, count2, strval); - } - offset += length + count; - break; - case MM_PREV_SENT_DATE_HDR: - /* Value-Length Forwarded-count-value Date-value */ - length = get_value_length(tvb, offset, &count); - if (tree) { - guint32 fwd_count, count1, count2; - guint tval; - nstime_t tmptime; - proto_tree *subtree = NULL; - proto_item *tii = NULL; - /* 1. Forwarded-count-value := Integer-value */ - fwd_count = get_integer_value(tvb, offset + count, - &count1); - /* 2. Date-value := Long-integer */ - tval = get_long_integer(tvb, offset + count + count1, - &count2); - tmptime.secs = tval; - tmptime.nsecs = 0; - strval = abs_time_to_str(wmem_packet_scope(), &tmptime, ABSOLUTE_TIME_LOCAL, - TRUE); - /* Now render the fields */ - tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); - tii = proto_tree_add_string_format(mmse_tree, - hf_mmse_prev_sent_date, - tvb, offset - 1, 1 + count + length, - strval, "%s (Forwarded-count=%u)", - format_text(strval, strlen(strval)), - fwd_count); - subtree = proto_item_add_subtree(tii, - ett_mmse_hdr_details); - proto_tree_add_uint(subtree, - hf_mmse_prev_sent_date_fwd_count, - tvb, offset + count, count1, fwd_count); - proto_tree_add_string(subtree, - hf_mmse_prev_sent_date_date, - tvb, offset + count + count1, count2, strval); - } - offset += length + count; - break; - - /* MMS Encapsulation 1.2 */ - - default: - if (field & 0x80) { /* Well-known WSP header encoding */ - guint8 peek = tvb_get_guint8(tvb, offset); - const char *hdr_name = val_to_str(field, vals_mm_header_names, - "Unknown field (0x%02x)"); + while ((offset < tvb_reported_length(tvb)) && + (field = tvb_get_guint8(tvb, offset++)) != MM_CTYPE_HDR) + { + DebugLog(("\tField = 0x%02X (offset = %u): %s\n", + field, offset, + val_to_str(field, vals_mm_header_names, + "Unknown MMS header 0x%02X"))); + switch (field) + { + case MM_TID_HDR: /* Text-string */ + length = get_text_string(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, hf_mmse_transaction_id, + tvb, offset - 1, length + 1,strval); + } + offset += length; + break; + case MM_VERSION_HDR: /* nibble-Major/nibble-minor*/ + version = tvb_get_guint8(tvb, offset++); + if (tree) { + guint8 major, minor; + char *vers_string; + + major = (version & 0x70) >> 4; + minor = version & 0x0F; + if (minor == 0x0F) + vers_string = wmem_strdup_printf(wmem_packet_scope(), "%u", major); + else + vers_string = wmem_strdup_printf(wmem_packet_scope(), "%u.%u", major, minor); + proto_tree_add_string(mmse_tree, hf_mmse_mms_version, + tvb, offset - 2, 2, vers_string); + } + break; + case MM_BCC_HDR: /* Encoded-string-value */ + length = get_encoded_strval(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, hf_mmse_bcc, tvb, + offset - 1, length + 1, strval); + } + offset += length; + break; + case MM_CC_HDR: /* Encoded-string-value */ + length = get_encoded_strval(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, hf_mmse_cc, tvb, + offset - 1, length + 1, strval); + } + offset += length; + break; + case MM_CLOCATION_HDR: /* Uri-value */ + if (pdut == PDU_M_MBOX_DELETE_CONF) { + /* General form with length */ + length = tvb_get_guint8(tvb, offset); + if (length == 0x1F) { + guint length_len = 0; + length = tvb_get_guintvar(tvb, offset + 1, + &length_len); + length += 1 + length_len; + } else { + length += 1; + } + if (tree) { + tvb_ensure_bytes_exist(tvb, offset - 1, length + 1); + proto_tree_add_string(mmse_tree, + hf_mmse_content_location, + tvb, offset - 1, length + 1, + "<Undecoded value for m-mbox-delete-conf>"); + } + } else { + length = get_text_string(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, + hf_mmse_content_location, + tvb, offset - 1, length + 1, strval); + } + } + offset += length; + break; + case MM_DATE_HDR: /* Long-integer */ + { + guint tval; + nstime_t tmptime; + + tval = get_long_integer(tvb, offset, &count); + tmptime.secs = tval; + tmptime.nsecs = 0; + if (tree) { + tvb_ensure_bytes_exist(tvb, offset - 1, count + 1); + proto_tree_add_time(mmse_tree, hf_mmse_date, tvb, + offset - 1, count + 1, &tmptime); + } + } + offset += count; + break; + case MM_DREPORT_HDR: /* Yes|No */ + field = tvb_get_guint8(tvb, offset++); + if (tree) { + proto_tree_add_uint(mmse_tree, + hf_mmse_delivery_report, + tvb, offset - 2, 2, field); + } + break; + case MM_DTIME_HDR: + /* + * Value-length(Absolute-token Date-value| + * Relative-token Delta-seconds-value) + */ + length = get_value_length(tvb, offset, &count); + field = tvb_get_guint8(tvb, offset + count); + if (tree) { + guint tval; + nstime_t tmptime; + guint cnt; + + tval = get_long_integer(tvb, offset + count + 1, &cnt); + tmptime.secs = tval; + tmptime.nsecs = 0; + + tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); + if (field == 0x80) + proto_tree_add_time(mmse_tree, + hf_mmse_delivery_time_abs, + tvb, offset - 1, + length + count + 1, &tmptime); + else + proto_tree_add_time(mmse_tree, + hf_mmse_delivery_time_rel, + tvb, offset - 1, + length + count + 1, &tmptime); + } + offset += length + count; + break; + case MM_EXPIRY_HDR: + /* + * Value-length(Absolute-token Date-value| + * Relative-token Delta-seconds-value) + */ + length = get_value_length(tvb, offset, &count); + field = tvb_get_guint8(tvb, offset + count); + if (tree) { + guint tval; + nstime_t tmptime; + guint cnt; + + tval = get_long_integer(tvb, offset + count + 1, &cnt); + tmptime.secs = tval; + tmptime.nsecs = 0; + + tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); + if (field == 0x80) + proto_tree_add_time(mmse_tree, hf_mmse_expiry_abs, + tvb, offset - 1, + length + count + 1, &tmptime); + else + proto_tree_add_time(mmse_tree, hf_mmse_expiry_rel, + tvb, offset - 1, + length + count + 1, &tmptime); + } + offset += length + count; + break; + case MM_FROM_HDR: + /* + * Value-length(Address-present-token Encoded-string-value + * |Insert-address-token) + */ + length = get_value_length(tvb, offset, &count); + if (tree) { + field = tvb_get_guint8(tvb, offset + count); + tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); + if (field == 0x81) { + proto_tree_add_string(mmse_tree, hf_mmse_from, tvb, + offset-1, length + count + 1, + "<insert address>"); + } else { + (void) get_encoded_strval(tvb, offset + count + 1, + &strval); + proto_tree_add_string(mmse_tree, hf_mmse_from, tvb, + offset-1, length + count + 1, strval); + } + } + offset += length + count; + break; + case MM_MCLASS_HDR: + /* + * Class-identifier|Text-string + */ + field = tvb_get_guint8(tvb, offset); + if (field & 0x80) { + offset++; + if (tree) { + proto_tree_add_uint(mmse_tree, + hf_mmse_message_class_id, + tvb, offset - 2, 2, field); + } + } else { + length = get_text_string(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, + hf_mmse_message_class_str, + tvb, offset - 1, length + 1, + strval); + } + offset += length; + } + break; + case MM_MID_HDR: /* Text-string */ + length = get_text_string(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, hf_mmse_message_id, + tvb, offset - 1, length + 1, strval); + } + offset += length; + break; + case MM_MSIZE_HDR: /* Long-integer */ + length = get_long_integer(tvb, offset, &count); + if (tree) { + proto_tree_add_uint(mmse_tree, hf_mmse_message_size, + tvb, offset - 1, count + 1, length); + } + offset += count; + break; + case MM_PRIORITY_HDR: /* Low|Normal|High */ + field = tvb_get_guint8(tvb, offset++); + if (tree) { + proto_tree_add_uint(mmse_tree, hf_mmse_priority, tvb, + offset - 2, 2, field); + } + break; + case MM_RREPLY_HDR: /* Yes|No */ + field = tvb_get_guint8(tvb, offset++); + if (tree) { + if (version == 0x80) { /* MMSE 1.0 */ + proto_tree_add_uint(mmse_tree, hf_mmse_read_reply, + tvb, offset - 2, 2, field); + } else { + proto_tree_add_uint(mmse_tree, hf_mmse_read_report, + tvb, offset - 2, 2, field); + } + } + break; + case MM_RALLOWED_HDR: /* Yes|No */ + field = tvb_get_guint8(tvb, offset++); + if (tree) { + proto_tree_add_uint(mmse_tree, hf_mmse_report_allowed, + tvb, offset - 2, 2, field); + } + break; + case MM_RSTATUS_HDR: + field = tvb_get_guint8(tvb, offset++); + if (tree) { + proto_tree_add_uint(mmse_tree, hf_mmse_response_status, + tvb, offset - 2, 2, field); + } + break; + case MM_RTEXT_HDR: /* Encoded-string-value */ + if (pdut == PDU_M_MBOX_DELETE_CONF) { + /* General form with length */ + length = tvb_get_guint8(tvb, offset); + if (length == 0x1F) { + guint length_len = 0; + length = tvb_get_guintvar(tvb, offset + 1, + &length_len); + length += 1 + length_len; + } else { + length += 1; + } + if (tree) { + proto_tree_add_string(mmse_tree, + hf_mmse_content_location, + tvb, offset - 1, length + 1, + "<Undecoded value for m-mbox-delete-conf>"); + } + } else { + length = get_encoded_strval(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, + hf_mmse_response_text, tvb, offset - 1, + length + 1, strval); + } + } + offset += length; + break; + case MM_SVISIBILITY_HDR: /* Hide|Show */ + field = tvb_get_guint8(tvb, offset++); + if (tree) { + proto_tree_add_uint(mmse_tree,hf_mmse_sender_visibility, + tvb, offset - 2, 2, field); + } + break; + case MM_STATUS_HDR: + field = tvb_get_guint8(tvb, offset++); + if (tree) { + proto_tree_add_uint(mmse_tree, hf_mmse_status, tvb, + offset - 2, 2, field); + } + break; + case MM_SUBJECT_HDR: /* Encoded-string-value */ + length = get_encoded_strval(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, hf_mmse_subject, tvb, + offset - 1, length + 1, strval); + } + offset += length; + break; + case MM_TO_HDR: /* Encoded-string-value */ + length = get_encoded_strval(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, hf_mmse_to, tvb, + offset - 1, length + 1, strval); + } + offset += length; + break; + + /* + * MMS Encapsulation 1.1 + */ + case MM_RETRIEVE_STATUS_HDR: /* Well-known-value */ + field = tvb_get_guint8(tvb, offset++); + if (tree) { + proto_tree_add_uint(mmse_tree, hf_mmse_retrieve_status, + tvb, offset - 2, 2, field); + } + break; + case MM_RETRIEVE_TEXT_HDR: + if (pdut == PDU_M_MBOX_DELETE_CONF) { + /* General form with length */ + length = tvb_get_guint8(tvb, offset); + if (length == 0x1F) { + guint length_len = 0; + length = tvb_get_guintvar(tvb, offset + 1, + &length_len); + length += 1 + length_len; + } else { + length += 1; + } + if (tree) { + proto_tree_add_string(mmse_tree, + hf_mmse_content_location, + tvb, offset - 1, length + 1, + "<Undecoded value for m-mbox-delete-conf>"); + } + } else { + /* Encoded-string-value */ + length = get_encoded_strval(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, + hf_mmse_retrieve_text, tvb, offset - 1, + length + 1, strval); + } + } + offset += length; + break; + case MM_READ_STATUS_HDR: /* Well-known-value */ + field = tvb_get_guint8(tvb, offset++); + if (tree) { + proto_tree_add_uint(mmse_tree, hf_mmse_read_status, + tvb, offset - 2, 2, field); + } + break; + case MM_REPLY_CHARGING_HDR: /* Well-known-value */ + field = tvb_get_guint8(tvb, offset++); + if (tree) { + proto_tree_add_uint(mmse_tree, hf_mmse_reply_charging, + tvb, offset - 2, 2, field); + } + break; + case MM_REPLY_CHARGING_DEADLINE_HDR: /* Well-known-value */ + /* + * Value-length(Absolute-token Date-value| + * Relative-token Delta-seconds-value) + */ + length = get_value_length(tvb, offset, &count); + field = tvb_get_guint8(tvb, offset + count); + if (tree) { + guint tval; + nstime_t tmptime; + guint cnt; + + tval = get_long_integer(tvb, offset + count + 1, &cnt); + tmptime.secs = tval; + tmptime.nsecs = 0; + + tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); + if (field == 0x80) + proto_tree_add_time(mmse_tree, hf_mmse_reply_charging_deadline_abs, + tvb, offset - 1, + length + count + 1, &tmptime); + else + proto_tree_add_time(mmse_tree, hf_mmse_reply_charging_deadline_rel, + tvb, offset - 1, + length + count + 1, &tmptime); + } + offset += length + count; + break; + case MM_REPLY_CHARGING_ID_HDR: /* Text-string */ + length = get_text_string(tvb, offset, &strval); + if (tree) { + proto_tree_add_string(mmse_tree, + hf_mmse_reply_charging_id, + tvb, offset - 1, length + 1, strval); + } + offset += length; + break; + case MM_REPLY_CHARGING_SIZE_HDR: /* Long-integer */ + length = get_long_integer(tvb, offset, &count); + if (tree) { + proto_tree_add_uint(mmse_tree, + hf_mmse_reply_charging_size, + tvb, offset - 1, count + 1, length); + } + offset += count; + break; + case MM_PREV_SENT_BY_HDR: + /* Value-length Integer-value Encoded-string-value */ + length = get_value_length(tvb, offset, &count); + if (tree) { + guint32 fwd_count, count1, count2; + proto_tree *subtree = NULL; + proto_item *tii = NULL; + /* 1. Forwarded-count-value := Integer-value */ + fwd_count = get_integer_value(tvb, offset + count, + &count1); + /* 2. Encoded-string-value */ + count2 = get_encoded_strval(tvb, + offset + count + count1, &strval); + /* Now render the fields */ + tii = proto_tree_add_string_format(mmse_tree, + hf_mmse_prev_sent_by, + tvb, offset - 1, 1 + count + length, + strval, "%s (Forwarded-count=%u)", + format_text(strval, strlen(strval)), + fwd_count); + subtree = proto_item_add_subtree(tii, + ett_mmse_hdr_details); + proto_tree_add_uint(subtree, + hf_mmse_prev_sent_by_fwd_count, + tvb, offset + count, count1, fwd_count); + proto_tree_add_string(subtree, + hf_mmse_prev_sent_by_address, + tvb, offset + count + count1, count2, strval); + } + offset += length + count; + break; + case MM_PREV_SENT_DATE_HDR: + /* Value-Length Forwarded-count-value Date-value */ + length = get_value_length(tvb, offset, &count); + if (tree) { + guint32 fwd_count, count1, count2; + guint tval; + nstime_t tmptime; + proto_tree *subtree = NULL; + proto_item *tii = NULL; + /* 1. Forwarded-count-value := Integer-value */ + fwd_count = get_integer_value(tvb, offset + count, + &count1); + /* 2. Date-value := Long-integer */ + tval = get_long_integer(tvb, offset + count + count1, + &count2); + tmptime.secs = tval; + tmptime.nsecs = 0; + strval = abs_time_to_str(wmem_packet_scope(), &tmptime, ABSOLUTE_TIME_LOCAL, + TRUE); + /* Now render the fields */ + tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1); + tii = proto_tree_add_string_format(mmse_tree, + hf_mmse_prev_sent_date, + tvb, offset - 1, 1 + count + length, + strval, "%s (Forwarded-count=%u)", + format_text(strval, strlen(strval)), + fwd_count); + subtree = proto_item_add_subtree(tii, + ett_mmse_hdr_details); + proto_tree_add_uint(subtree, + hf_mmse_prev_sent_date_fwd_count, + tvb, offset + count, count1, fwd_count); + proto_tree_add_string(subtree, + hf_mmse_prev_sent_date_date, + tvb, offset + count + count1, count2, strval); + } + offset += length + count; + break; + + /* MMS Encapsulation 1.2 */ + + default: + if (field & 0x80) { /* Well-known WSP header encoding */ + guint8 peek = tvb_get_guint8(tvb, offset); + const char *hdr_name = val_to_str(field, vals_mm_header_names, + "Unknown field (0x%02x)"); const char *str; - DebugLog(("\t\tUndecoded well-known header: %s\n", - hdr_name)); - - if (peek & 0x80) { /* Well-known value */ - length = 1; - if (tree) { - proto_tree_add_uint_format(mmse_tree, hf_mmse_header_uint, tvb, offset - 1, - length + 1, peek, - "%s: <Well-known value 0x%02x>" - " (not decoded)", - hdr_name, peek); - } - } else if ((peek == 0) || (peek >= 0x20)) { /* Text */ - length = get_text_string(tvb, offset, &strval); - if (tree) { - str = format_text(strval, strlen(strval)); - proto_tree_add_string_format(mmse_tree, hf_mmse_header_string, tvb, offset - 1, - length + 1, str, "%s: %s (Not decoded)", hdr_name, str); - } - } else { /* General form with length */ - if (peek == 0x1F) { /* Value length in guintvar */ - guint length_len = 0; - length = 1 + tvb_get_guintvar(tvb, offset + 1, - &length_len); - length += length_len; - } else { /* Value length in octet */ - length = 1 + tvb_get_guint8(tvb, offset); - } - if (tree) { - proto_tree_add_bytes_format(mmse_tree, hf_mmse_header_bytes, tvb, offset - 1, - length + 1, NULL, "%s: " - "<Value in general form> (not decoded)", - hdr_name); - } - } - offset += length; - } else { /* Literal WSP header encoding */ - guint length2; - const char *strval2; - - --offset; - length = get_text_string(tvb, offset, &strval); - DebugLog(("\t\tUndecoded literal header: %s\n", - strval)); - length2= get_text_string(tvb, offset+length, &strval2); - - if (tree) { - proto_tree_add_string_format(mmse_tree, - hf_mmse_ffheader, tvb, offset, - length + length2, - tvb_get_string_enc(wmem_packet_scope(), tvb, offset, - length + length2, ENC_ASCII), - "%s: %s", - format_text(strval, strlen(strval)), - format_text(strval2, strlen(strval2))); - } - offset += length + length2; - } - break; - } - DebugLog(("\tEnd(case)\n")); - } - DebugLog(("\tEnd(switch)\n")); - if (field == MM_CTYPE_HDR) { - /* - * Eeehh, we're now actually back to good old WSP content-type - * encoding. Let's steal that from the WSP-dissector. - */ - tvbuff_t *tmp_tvb; - guint type; - const char *type_str; - - DebugLog(("Content-Type: [from WSP dissector]\n")); - DebugLog(("Calling add_content_type() in WSP dissector\n")); - offset = add_content_type(mmse_tree, tvb, offset, &type, &type_str); - DebugLog(("Generating new TVB subset (offset = %u)\n", offset)); - tmp_tvb = tvb_new_subset_remaining(tvb, offset); - DebugLog(("Add POST data\n")); - add_post_data(mmse_tree, tmp_tvb, type, type_str, pinfo); - DebugLog(("Done!\n")); - } + DebugLog(("\t\tUndecoded well-known header: %s\n", + hdr_name)); + + if (peek & 0x80) { /* Well-known value */ + length = 1; + if (tree) { + proto_tree_add_uint_format(mmse_tree, hf_mmse_header_uint, tvb, offset - 1, + length + 1, peek, + "%s: <Well-known value 0x%02x>" + " (not decoded)", + hdr_name, peek); + } + } else if ((peek == 0) || (peek >= 0x20)) { /* Text */ + length = get_text_string(tvb, offset, &strval); + if (tree) { + str = format_text(strval, strlen(strval)); + proto_tree_add_string_format(mmse_tree, hf_mmse_header_string, tvb, offset - 1, + length + 1, str, "%s: %s (Not decoded)", hdr_name, str); + } + } else { /* General form with length */ + if (peek == 0x1F) { /* Value length in guintvar */ + guint length_len = 0; + length = 1 + tvb_get_guintvar(tvb, offset + 1, + &length_len); + length += length_len; + } else { /* Value length in octet */ + length = 1 + tvb_get_guint8(tvb, offset); + } + if (tree) { + proto_tree_add_bytes_format(mmse_tree, hf_mmse_header_bytes, tvb, offset - 1, + length + 1, NULL, "%s: " + "<Value in general form> (not decoded)", + hdr_name); + } + } + offset += length; + } else { /* Literal WSP header encoding */ + guint length2; + const char *strval2; + + --offset; + length = get_text_string(tvb, offset, &strval); + DebugLog(("\t\tUndecoded literal header: %s\n", + strval)); + length2= get_text_string(tvb, offset+length, &strval2); + + if (tree) { + proto_tree_add_string_format(mmse_tree, + hf_mmse_ffheader, tvb, offset, + length + length2, + tvb_get_string_enc(wmem_packet_scope(), tvb, offset, + length + length2, ENC_ASCII), + "%s: %s", + format_text(strval, strlen(strval)), + format_text(strval2, strlen(strval2))); + } + offset += length + length2; + } + break; + } + DebugLog(("\tEnd(case)\n")); + } + DebugLog(("\tEnd(switch)\n")); + if (field == MM_CTYPE_HDR) { + /* + * Eeehh, we're now actually back to good old WSP content-type + * encoding. Let's steal that from the WSP-dissector. + */ + tvbuff_t *tmp_tvb; + guint type; + const char *type_str; + + DebugLog(("Content-Type: [from WSP dissector]\n")); + DebugLog(("Calling add_content_type() in WSP dissector\n")); + offset = add_content_type(mmse_tree, tvb, offset, &type, &type_str); + DebugLog(("Generating new TVB subset (offset = %u)\n", offset)); + tmp_tvb = tvb_new_subset_remaining(tvb, offset); + DebugLog(("Add POST data\n")); + add_post_data(mmse_tree, tmp_tvb, type, type_str, pinfo); + DebugLog(("Done!\n")); + } } else { - DebugLog(("tree == NULL and PDU has no potential content\n")); + DebugLog(("tree == NULL and PDU has no potential content\n")); } /* If this protocol has a sub-dissector call it here, see section 1.8 */ @@ -1330,339 +1330,339 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, void proto_register_mmse(void) { - /* Setup list of header fields See Section 1.6.1 for details */ + /* Setup list of header fields See Section 1.6.1 for details */ static hf_register_info hf[] = { - { &hf_mmse_message_type, - { "X-Mms-Message-Type", "mmse.message_type", - FT_UINT8, BASE_HEX, VALS(vals_message_type), 0x00, - "Specifies the transaction type. Effectively defines PDU.", - HFILL - } - }, - { &hf_mmse_transaction_id, - { "X-Mms-Transaction-ID", "mmse.transaction_id", - FT_STRING, BASE_NONE, NULL, 0x00, - "A unique identifier for this transaction. Identifies request and corresponding response only.", - HFILL - } - }, - { &hf_mmse_mms_version, - { "X-Mms-MMS-Version", "mmse.mms_version", - FT_STRING, BASE_NONE, NULL, 0x00, - "Version of the protocol used.", - HFILL - } - }, - { &hf_mmse_bcc, - { "Bcc", "mmse.bcc", - FT_STRING, BASE_NONE, NULL, 0x00, - "Blind carbon copy.", - HFILL - } - }, - { &hf_mmse_cc, - { "Cc", "mmse.cc", - FT_STRING, BASE_NONE, NULL, 0x00, - "Carbon copy.", - HFILL - } - }, - { &hf_mmse_content_location, - { "X-Mms-Content-Location", "mmse.content_location", - FT_STRING, BASE_NONE, NULL, 0x00, - "Defines the location of the message.", - HFILL - } - }, - { &hf_mmse_date, - { "Date", "mmse.date", - FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, - "Arrival timestamp of the message or sending timestamp.", - HFILL - } - }, - { &hf_mmse_delivery_report, - { "X-Mms-Delivery-Report", "mmse.delivery_report", - FT_UINT8, BASE_HEX, VALS(vals_yes_no), 0x00, - "Whether a report of message delivery is wanted or not.", - HFILL - } - }, - { &hf_mmse_delivery_time_abs, - { "X-Mms-Delivery-Time", "mmse.delivery_time.abs", - FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, - "The time at which message delivery is desired.", - HFILL - } - }, - { &hf_mmse_delivery_time_rel, - { "X-Mms-Delivery-Time", "mmse.delivery_time.rel", - FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00, - "The desired message delivery delay.", - HFILL - } - }, - { &hf_mmse_expiry_abs, - { "X-Mms-Expiry", "mmse.expiry.abs", - FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, - "Time when message expires and need not be delivered anymore.", - HFILL - } - }, - { &hf_mmse_expiry_rel, - { "X-Mms-Expiry", "mmse.expiry.rel", - FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00, - "Delay before message expires and need not be delivered anymore.", - HFILL - } - }, - { &hf_mmse_from, - { "From", "mmse.from", - FT_STRING, BASE_NONE, NULL, 0x00, - "Address of the message sender.", - HFILL - } - }, - { &hf_mmse_message_class_id, - { "X-Mms-Message-Class", "mmse.message_class.id", - FT_UINT8, BASE_HEX, VALS(vals_message_class), 0x00, - "Of what category is the message.", - HFILL - } - }, - { &hf_mmse_message_class_str, - { "X-Mms-Message-Class", "mmse.message_class.str", - FT_STRING, BASE_NONE, NULL, 0x00, - "Of what category is the message.", - HFILL - } - }, - { &hf_mmse_message_id, - { "Message-Id", "mmse.message_id", - FT_STRING, BASE_NONE, NULL, 0x00, - "Unique identification of the message.", - HFILL - } - }, - { &hf_mmse_message_size, - { "X-Mms-Message-Size", "mmse.message_size", - FT_UINT32, BASE_DEC, NULL, 0x00, - "The size of the message in octets.", - HFILL - } - }, - { &hf_mmse_priority, - { "X-Mms-Priority", "mmse.priority", - FT_UINT8, BASE_HEX, VALS(vals_priority), 0x00, - "Priority of the message.", - HFILL - } - }, - { &hf_mmse_read_reply, - { "X-Mms-Read-Reply", "mmse.read_reply", - FT_UINT8, BASE_HEX, VALS(vals_yes_no), 0x00, - "Whether a read report from every recipient is wanted.", - HFILL - } - }, - { &hf_mmse_read_report, - { "X-Mms-Read-Report", "mmse.read_report", - FT_UINT8, BASE_HEX, VALS(vals_yes_no), 0x00, - "Whether a read report from every recipient is wanted.", - HFILL - } - }, - { &hf_mmse_report_allowed, - { "X-Mms-Report-Allowed", "mmse.report_allowed", - FT_UINT8, BASE_HEX, VALS(vals_yes_no), 0x00, - "Sending of delivery report allowed or not.", - HFILL - } - }, - { &hf_mmse_response_status, - { "Response-Status", "mmse.response_status", - FT_UINT8, BASE_HEX, VALS(vals_response_status), 0x00, - "MMS-specific result of a message submission or retrieval.", - HFILL - } - }, - { &hf_mmse_response_text, - { "Response-Text", "mmse.response_text", - FT_STRING, BASE_NONE, NULL, 0x00, - "Additional information on MMS-specific result.", - HFILL - } - }, - { &hf_mmse_sender_visibility, - { "Sender-Visibility", "mmse.sender_visibility", - FT_UINT8, BASE_HEX, VALS(vals_sender_visibility), 0x00, - "Disclose sender identity to receiver or not.", - HFILL - } - }, - { &hf_mmse_status, - { "Status", "mmse.status", - FT_UINT8, BASE_HEX, VALS(vals_message_status), 0x00, - "Current status of the message.", - HFILL - } - }, - { &hf_mmse_subject, - { "Subject", "mmse.subject", - FT_STRING, BASE_NONE, NULL, 0x00, - "Subject of the message.", - HFILL - } - }, - { &hf_mmse_to, - { "To", "mmse.to", - FT_STRING, BASE_NONE, NULL, 0x00, - "Recipient(s) of the message.", - HFILL - } - }, + { &hf_mmse_message_type, + { "X-Mms-Message-Type", "mmse.message_type", + FT_UINT8, BASE_HEX, VALS(vals_message_type), 0x00, + "Specifies the transaction type. Effectively defines PDU.", + HFILL + } + }, + { &hf_mmse_transaction_id, + { "X-Mms-Transaction-ID", "mmse.transaction_id", + FT_STRING, BASE_NONE, NULL, 0x00, + "A unique identifier for this transaction. Identifies request and corresponding response only.", + HFILL + } + }, + { &hf_mmse_mms_version, + { "X-Mms-MMS-Version", "mmse.mms_version", + FT_STRING, BASE_NONE, NULL, 0x00, + "Version of the protocol used.", + HFILL + } + }, + { &hf_mmse_bcc, + { "Bcc", "mmse.bcc", + FT_STRING, BASE_NONE, NULL, 0x00, + "Blind carbon copy.", + HFILL + } + }, + { &hf_mmse_cc, + { "Cc", "mmse.cc", + FT_STRING, BASE_NONE, NULL, 0x00, + "Carbon copy.", + HFILL + } + }, + { &hf_mmse_content_location, + { "X-Mms-Content-Location", "mmse.content_location", + FT_STRING, BASE_NONE, NULL, 0x00, + "Defines the location of the message.", + HFILL + } + }, + { &hf_mmse_date, + { "Date", "mmse.date", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, + "Arrival timestamp of the message or sending timestamp.", + HFILL + } + }, + { &hf_mmse_delivery_report, + { "X-Mms-Delivery-Report", "mmse.delivery_report", + FT_UINT8, BASE_HEX, VALS(vals_yes_no), 0x00, + "Whether a report of message delivery is wanted or not.", + HFILL + } + }, + { &hf_mmse_delivery_time_abs, + { "X-Mms-Delivery-Time", "mmse.delivery_time.abs", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, + "The time at which message delivery is desired.", + HFILL + } + }, + { &hf_mmse_delivery_time_rel, + { "X-Mms-Delivery-Time", "mmse.delivery_time.rel", + FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00, + "The desired message delivery delay.", + HFILL + } + }, + { &hf_mmse_expiry_abs, + { "X-Mms-Expiry", "mmse.expiry.abs", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, + "Time when message expires and need not be delivered anymore.", + HFILL + } + }, + { &hf_mmse_expiry_rel, + { "X-Mms-Expiry", "mmse.expiry.rel", + FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00, + "Delay before message expires and need not be delivered anymore.", + HFILL + } + }, + { &hf_mmse_from, + { "From", "mmse.from", + FT_STRING, BASE_NONE, NULL, 0x00, + "Address of the message sender.", + HFILL + } + }, + { &hf_mmse_message_class_id, + { "X-Mms-Message-Class", "mmse.message_class.id", + FT_UINT8, BASE_HEX, VALS(vals_message_class), 0x00, + "Of what category is the message.", + HFILL + } + }, + { &hf_mmse_message_class_str, + { "X-Mms-Message-Class", "mmse.message_class.str", + FT_STRING, BASE_NONE, NULL, 0x00, + "Of what category is the message.", + HFILL + } + }, + { &hf_mmse_message_id, + { "Message-Id", "mmse.message_id", + FT_STRING, BASE_NONE, NULL, 0x00, + "Unique identification of the message.", + HFILL + } + }, + { &hf_mmse_message_size, + { "X-Mms-Message-Size", "mmse.message_size", + FT_UINT32, BASE_DEC, NULL, 0x00, + "The size of the message in octets.", + HFILL + } + }, + { &hf_mmse_priority, + { "X-Mms-Priority", "mmse.priority", + FT_UINT8, BASE_HEX, VALS(vals_priority), 0x00, + "Priority of the message.", + HFILL + } + }, + { &hf_mmse_read_reply, + { "X-Mms-Read-Reply", "mmse.read_reply", + FT_UINT8, BASE_HEX, VALS(vals_yes_no), 0x00, + "Whether a read report from every recipient is wanted.", + HFILL + } + }, + { &hf_mmse_read_report, + { "X-Mms-Read-Report", "mmse.read_report", + FT_UINT8, BASE_HEX, VALS(vals_yes_no), 0x00, + "Whether a read report from every recipient is wanted.", + HFILL + } + }, + { &hf_mmse_report_allowed, + { "X-Mms-Report-Allowed", "mmse.report_allowed", + FT_UINT8, BASE_HEX, VALS(vals_yes_no), 0x00, + "Sending of delivery report allowed or not.", + HFILL + } + }, + { &hf_mmse_response_status, + { "Response-Status", "mmse.response_status", + FT_UINT8, BASE_HEX, VALS(vals_response_status), 0x00, + "MMS-specific result of a message submission or retrieval.", + HFILL + } + }, + { &hf_mmse_response_text, + { "Response-Text", "mmse.response_text", + FT_STRING, BASE_NONE, NULL, 0x00, + "Additional information on MMS-specific result.", + HFILL + } + }, + { &hf_mmse_sender_visibility, + { "Sender-Visibility", "mmse.sender_visibility", + FT_UINT8, BASE_HEX, VALS(vals_sender_visibility), 0x00, + "Disclose sender identity to receiver or not.", + HFILL + } + }, + { &hf_mmse_status, + { "Status", "mmse.status", + FT_UINT8, BASE_HEX, VALS(vals_message_status), 0x00, + "Current status of the message.", + HFILL + } + }, + { &hf_mmse_subject, + { "Subject", "mmse.subject", + FT_STRING, BASE_NONE, NULL, 0x00, + "Subject of the message.", + HFILL + } + }, + { &hf_mmse_to, + { "To", "mmse.to", + FT_STRING, BASE_NONE, NULL, 0x00, + "Recipient(s) of the message.", + HFILL + } + }, #if 0 - { &hf_mmse_content_type, - { "Data", "mmse.content_type", - FT_NONE, BASE_NONE, NULL, 0x00, - "Media content of the message.", - HFILL - } - }, + { &hf_mmse_content_type, + { "Data", "mmse.content_type", + FT_NONE, BASE_NONE, NULL, 0x00, + "Media content of the message.", + HFILL + } + }, #endif - { &hf_mmse_ffheader, - { "Free format (not encoded) header", "mmse.ffheader", - FT_STRING, BASE_NONE, NULL, 0x00, - "Application header without corresponding encoding.", - HFILL - } - }, - /* MMSE 1.1 */ - { &hf_mmse_retrieve_status, - { "X-Mms-Retrieve-Status", "mmse.retrieve_status", - FT_UINT8, BASE_HEX, VALS(vals_retrieve_status), 0x00, - "MMS-specific result of a message retrieval.", - HFILL - } - }, - { &hf_mmse_retrieve_text, - { "X-Mms-Retrieve-Text", "mmse.retrieve_text", - FT_STRING, BASE_NONE, NULL, 0x00, - "Status text of a MMS message retrieval.", - HFILL - } - }, - { &hf_mmse_read_status, - { "X-Mms-Read-Status", "mmse.read_status", - FT_UINT8, BASE_HEX, VALS(vals_read_status), 0x00, - "MMS-specific message read status.", - HFILL - } - }, - { &hf_mmse_reply_charging, - { "X-Mms-Reply-Charging", "mmse.reply_charging", - FT_UINT8, BASE_HEX, VALS(vals_reply_charging), 0x00, - "MMS-specific message reply charging method.", - HFILL - } - }, - { &hf_mmse_reply_charging_deadline_abs, - { "X-Mms-Reply-Charging-Deadline", "mmse.reply_charging_deadline.abs", - FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, - "The latest time of the recipient(s) to submit the Reply MM.", - HFILL - } - }, - { &hf_mmse_reply_charging_deadline_rel, - { "X-Mms-Reply-Charging-Deadline", "mmse.reply_charging_deadline.rel", - FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00, - "The latest time of the recipient(s) to submit the Reply MM.", - HFILL - } - }, - { &hf_mmse_reply_charging_id, - { "X-Mms-Reply-Charging-Id", "mmse.reply_charging_id", - FT_STRING, BASE_NONE, NULL, 0x00, - "Unique reply charging identification of the message.", - HFILL - } - }, - { &hf_mmse_reply_charging_size, - { "X-Mms-Reply-Charging-Size", "mmse.reply_charging_size", - FT_UINT32, BASE_DEC, NULL, 0x00, - "The size of the reply charging in octets.", - HFILL - } - }, - { &hf_mmse_prev_sent_by, - { "X-Mms-Previously-Sent-By", "mmse.previously_sent_by", - FT_STRING, BASE_NONE, NULL, 0x00, - "Indicates that the MM has been previously sent by this user.", - HFILL - } - }, - { &hf_mmse_prev_sent_by_fwd_count, - { "Forward Count", "mmse.previously_sent_by.forward_count", - FT_UINT32, BASE_DEC, NULL, 0x00, - "Forward count of the previously sent MM.", - HFILL - } - }, - { &hf_mmse_prev_sent_by_address, - { "Address", "mmse.previously_sent_by.address", - FT_STRING, BASE_NONE, NULL, 0x00, - "Indicates from whom the MM has been previously sent.", - HFILL - } - }, - { &hf_mmse_prev_sent_date, - { "X-Mms-Previously-Sent-Date", "mmse.previously_sent_date", - FT_STRING, BASE_NONE, NULL, 0x00, - "Indicates the date that the MM has been previously sent.", - HFILL - } - }, - { &hf_mmse_prev_sent_date_fwd_count, - { "Forward Count", "mmse.previously_sent_date.forward_count", - FT_UINT32, BASE_DEC, NULL, 0x00, - "Forward count of the previously sent MM.", - HFILL - } - }, - { &hf_mmse_prev_sent_date_date, - { "Date", "mmse.previously_sent_date.date", - FT_STRING, BASE_NONE, NULL, 0x00, - "Time when the MM has been previously sent.", - HFILL - } - }, - { &hf_mmse_header_uint, - { "Header Uint Value", "mmse.previously_sent_date.date", - FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL - } - }, - { &hf_mmse_header_string, - { "Header String Value", "mmse.header.string", - FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL - } - }, - { &hf_mmse_header_bytes, - { "Header Byte array", "mmse.header.bytes", - FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL - } - }, + { &hf_mmse_ffheader, + { "Free format (not encoded) header", "mmse.ffheader", + FT_STRING, BASE_NONE, NULL, 0x00, + "Application header without corresponding encoding.", + HFILL + } + }, + /* MMSE 1.1 */ + { &hf_mmse_retrieve_status, + { "X-Mms-Retrieve-Status", "mmse.retrieve_status", + FT_UINT8, BASE_HEX, VALS(vals_retrieve_status), 0x00, + "MMS-specific result of a message retrieval.", + HFILL + } + }, + { &hf_mmse_retrieve_text, + { "X-Mms-Retrieve-Text", "mmse.retrieve_text", + FT_STRING, BASE_NONE, NULL, 0x00, + "Status text of a MMS message retrieval.", + HFILL + } + }, + { &hf_mmse_read_status, + { "X-Mms-Read-Status", "mmse.read_status", + FT_UINT8, BASE_HEX, VALS(vals_read_status), 0x00, + "MMS-specific message read status.", + HFILL + } + }, + { &hf_mmse_reply_charging, + { "X-Mms-Reply-Charging", "mmse.reply_charging", + FT_UINT8, BASE_HEX, VALS(vals_reply_charging), 0x00, + "MMS-specific message reply charging method.", + HFILL + } + }, + { &hf_mmse_reply_charging_deadline_abs, + { "X-Mms-Reply-Charging-Deadline", "mmse.reply_charging_deadline.abs", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, + "The latest time of the recipient(s) to submit the Reply MM.", + HFILL + } + }, + { &hf_mmse_reply_charging_deadline_rel, + { "X-Mms-Reply-Charging-Deadline", "mmse.reply_charging_deadline.rel", + FT_RELATIVE_TIME, BASE_NONE, NULL, 0x00, + "The latest time of the recipient(s) to submit the Reply MM.", + HFILL + } + }, + { &hf_mmse_reply_charging_id, + { "X-Mms-Reply-Charging-Id", "mmse.reply_charging_id", + FT_STRING, BASE_NONE, NULL, 0x00, + "Unique reply charging identification of the message.", + HFILL + } + }, + { &hf_mmse_reply_charging_size, + { "X-Mms-Reply-Charging-Size", "mmse.reply_charging_size", + FT_UINT32, BASE_DEC, NULL, 0x00, + "The size of the reply charging in octets.", + HFILL + } + }, + { &hf_mmse_prev_sent_by, + { "X-Mms-Previously-Sent-By", "mmse.previously_sent_by", + FT_STRING, BASE_NONE, NULL, 0x00, + "Indicates that the MM has been previously sent by this user.", + HFILL + } + }, + { &hf_mmse_prev_sent_by_fwd_count, + { "Forward Count", "mmse.previously_sent_by.forward_count", + FT_UINT32, BASE_DEC, NULL, 0x00, + "Forward count of the previously sent MM.", + HFILL + } + }, + { &hf_mmse_prev_sent_by_address, + { "Address", "mmse.previously_sent_by.address", + FT_STRING, BASE_NONE, NULL, 0x00, + "Indicates from whom the MM has been previously sent.", + HFILL + } + }, + { &hf_mmse_prev_sent_date, + { "X-Mms-Previously-Sent-Date", "mmse.previously_sent_date", + FT_STRING, BASE_NONE, NULL, 0x00, + "Indicates the date that the MM has been previously sent.", + HFILL + } + }, + { &hf_mmse_prev_sent_date_fwd_count, + { "Forward Count", "mmse.previously_sent_date.forward_count", + FT_UINT32, BASE_DEC, NULL, 0x00, + "Forward count of the previously sent MM.", + HFILL + } + }, + { &hf_mmse_prev_sent_date_date, + { "Date", "mmse.previously_sent_date.date", + FT_STRING, BASE_NONE, NULL, 0x00, + "Time when the MM has been previously sent.", + HFILL + } + }, + { &hf_mmse_header_uint, + { "Header Uint Value", "mmse.previously_sent_date.date", + FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL + } + }, + { &hf_mmse_header_string, + { "Header String Value", "mmse.header.string", + FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL + } + }, + { &hf_mmse_header_bytes, + { "Header Byte array", "mmse.header.bytes", + FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL + } + }, }; /* Setup protocol subtree array */ static gint *ett[] = { - &ett_mmse, - &ett_mmse_hdr_details, + &ett_mmse, + &ett_mmse_hdr_details, }; /* Register the protocol name and description */ proto_mmse = proto_register_protocol("MMS Message Encapsulation", - "MMSE", "mmse"); + "MMSE", "mmse"); /* Required function calls to register header fields and subtrees used */ proto_register_field_array(proto_mmse, hf, array_length(hf)); @@ -1681,13 +1681,26 @@ proto_reg_handoff_mmse(void) heur_dissector_add("wsp", dissect_mmse_heur, proto_mmse); mmse_standalone_handle = create_dissector_handle( - dissect_mmse_standalone, proto_mmse); + dissect_mmse_standalone, proto_mmse); mmse_encapsulated_handle = create_dissector_handle( - dissect_mmse_encapsulated, proto_mmse); - /* As the media types for WSP and HTTP are the same, the WSP dissector - * uses the same string dissector table as the HTTP protocol. */ + dissect_mmse_encapsulated, proto_mmse); + /* As the media types for WSP and HTTP are the same, the WSP dissector + * uses the same string dissector table as the HTTP protocol. */ dissector_add_string("media_type", - "application/vnd.wap.mms-message", mmse_standalone_handle); + "application/vnd.wap.mms-message", mmse_standalone_handle); dissector_add_string("multipart_media_type", - "application/vnd.wap.mms-message", mmse_encapsulated_handle); + "application/vnd.wap.mms-message", mmse_encapsulated_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff --git a/epan/dissectors/packet-msproxy.c b/epan/dissectors/packet-msproxy.c index aec2cbbe6a..642f029b9d 100644 --- a/epan/dissectors/packet-msproxy.c +++ b/epan/dissectors/packet-msproxy.c @@ -217,8 +217,8 @@ static void msproxy_sub_dissector( tvbuff_t *tvb, packet_info *pinfo, "UDP packets")); if ( tree) { - ti = proto_tree_add_item( tree, proto_msproxy, tvb, 0, 0, - ENC_NA ); + ti = proto_tree_add_item( tree, proto_msproxy, tvb, 0, 0, + ENC_NA ); msp_tree = proto_item_add_subtree(ti, ett_msproxy); @@ -233,11 +233,11 @@ static void msproxy_sub_dissector( tvbuff_t *tvb, packet_info *pinfo, /* set pinfo->{src/dst port} and call the TCP or UDP sub-dissector lookup */ if ( pinfo->srcport == redirect_info->clnt_port) - ptr = &pinfo->destport; - else - ptr = &pinfo->srcport; + ptr = &pinfo->destport; + else + ptr = &pinfo->srcport; - *ptr = redirect_info->remote_port; + *ptr = redirect_info->remote_port; if ( redirect_info->proto == PT_TCP) decode_tcp_ports( tvb, 0, pinfo, tree, pinfo->srcport, @@ -246,7 +246,7 @@ static void msproxy_sub_dissector( tvbuff_t *tvb, packet_info *pinfo, decode_udp_ports( tvb, 0, pinfo, tree, pinfo->srcport, pinfo->destport, -1); - *ptr = redirect_info->server_int_port; + *ptr = redirect_info->server_int_port; } @@ -260,7 +260,7 @@ static void add_msproxy_conversation( packet_info *pinfo, /* conversation data structure with the info needed to call the TCP or */ /* UDP port decoder. */ -/* NOTE: Currently this assume that the conversation will be created */ +/* NOTE: Currently this assumes that the conversation will be created */ /* during a packet from the server. If that changes, pinfo->src */ /* and pinfo->dst will not be correct and this routine will have */ /* to change. */ @@ -588,7 +588,7 @@ static void dissect_request_resolve(tvbuff_t *tvb, int offset, offset += 17; proto_tree_add_text( name_tree, tvb, offset, length, "String: %s", - tvb_get_string_enc( wmem_packet_scope(), tvb, offset, length, ENC_ASCII)); + tvb_get_string_enc( wmem_packet_scope(), tvb, offset, length, ENC_ASCII)); } } @@ -1084,7 +1084,7 @@ static void dissect_msproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) hash_info = (hash_entry_t *)conversation_get_proto_data(conversation, proto_msproxy); if ( !hash_info) { - hash_info = wmem_new(wmem_file_scope(), hash_entry_t); + hash_info = wmem_new(wmem_file_scope(), hash_entry_t); conversation_add_proto_data(conversation, proto_msproxy, hash_info); } @@ -1128,140 +1128,142 @@ proto_register_msproxy( void){ &ett_msproxy, &ett_msproxy_name }; - static hf_register_info hf[] = { + static hf_register_info hf[] = { - { &hf_msproxy_cmd, - { "Command", "msproxy.command", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL - } + { &hf_msproxy_cmd, + { "Command", "msproxy.command", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_dstaddr, - { "Destination Address", "msproxy.dstaddr", FT_IPv4, BASE_NONE, NULL, - 0x0, NULL, HFILL - } + { "Destination Address", "msproxy.dstaddr", FT_IPv4, BASE_NONE, NULL, + 0x0, NULL, HFILL + } }, #if 0 { &hf_msproxy_srcport, - { "Source Port", "msproxy.srcport", FT_UINT16, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Source Port", "msproxy.srcport", FT_UINT16, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, #endif { &hf_msproxy_dstport, - { "Destination Port", "msproxy.dstport", FT_UINT16, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Destination Port", "msproxy.dstport", FT_UINT16, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_clntport, - { "Client Port", "msproxy.clntport", FT_UINT16, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Client Port", "msproxy.clntport", FT_UINT16, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_server_ext_addr, - { "Server External Address", "msproxy.server_ext_addr", FT_IPv4, BASE_NONE, NULL, - 0x0, NULL, HFILL - } + { "Server External Address", "msproxy.server_ext_addr", FT_IPv4, BASE_NONE, NULL, + 0x0, NULL, HFILL + } }, { &hf_msproxy_server_ext_port, - { "Server External Port", "msproxy.server_ext_port", FT_UINT16, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Server External Port", "msproxy.server_ext_port", FT_UINT16, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_server_int_addr, - { "Server Internal Address", "msproxy.server_int_addr", FT_IPv4, BASE_NONE, NULL, - 0x0, NULL, HFILL - } + { "Server Internal Address", "msproxy.server_int_addr", FT_IPv4, BASE_NONE, NULL, + 0x0, NULL, HFILL + } }, { &hf_msproxy_server_int_port, - { "Server Internal Port", "msproxy.server_int_port", FT_UINT16, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Server Internal Port", "msproxy.server_int_port", FT_UINT16, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_serverport, - { "Server Port", "msproxy.serverport", FT_UINT16, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Server Port", "msproxy.serverport", FT_UINT16, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_bindport, - { "Bind Port", "msproxy.bindport", FT_UINT16, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Bind Port", "msproxy.bindport", FT_UINT16, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_boundport, - { "Bound Port", "msproxy.boundport", FT_UINT16, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Bound Port", "msproxy.boundport", FT_UINT16, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_serveraddr, - { "Server Address", "msproxy.serveraddr", FT_IPv4, BASE_NONE, NULL, - 0x0, NULL, HFILL - } + { "Server Address", "msproxy.serveraddr", FT_IPv4, BASE_NONE, NULL, + 0x0, NULL, HFILL + } }, { &hf_msproxy_bindaddr, - { "Destination", "msproxy.bindaddr", FT_IPv4, BASE_NONE, NULL, - 0x0, NULL, HFILL - } + { "Destination", "msproxy.bindaddr", FT_IPv4, BASE_NONE, NULL, + 0x0, NULL, HFILL + } }, { &hf_msproxy_bind_id, - { "Bound Port Id", "msproxy.bindid", FT_UINT32, - BASE_HEX, NULL, 0x0, NULL, HFILL - } + { "Bound Port Id", "msproxy.bindid", FT_UINT32, + BASE_HEX, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_resolvaddr, - { "Address", "msproxy.resolvaddr", FT_IPv4, BASE_NONE, NULL, - 0x0, NULL, HFILL - } + { "Address", "msproxy.resolvaddr", FT_IPv4, BASE_NONE, NULL, + 0x0, NULL, HFILL + } }, { &hf_msproxy_client_id, - { "Client Id", "msproxy.client_id", FT_UINT32, - BASE_HEX, NULL, 0x0, NULL, HFILL - } + { "Client Id", "msproxy.client_id", FT_UINT32, + BASE_HEX, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_version, - { "Version", "msproxy.version", FT_UINT32, - BASE_HEX, NULL, 0x0, NULL, HFILL - } + { "Version", "msproxy.version", FT_UINT32, + BASE_HEX, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_server_id, - { "Server id", "msproxy.server_id", FT_UINT32, - BASE_HEX, NULL, 0x0, NULL, HFILL - } + { "Server id", "msproxy.server_id", FT_UINT32, + BASE_HEX, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_server_ack, - { "Server ack", "msproxy.server_ack", FT_UINT8, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Server ack", "msproxy.server_ack", FT_UINT8, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_client_ack, - { "Client ack", "msproxy.client_ack", FT_UINT8, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Client ack", "msproxy.client_ack", FT_UINT8, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_seq_num, - { "Sequence Number", "msproxy.seq_num", FT_UINT8, - BASE_DEC, NULL, 0x0, NULL, HFILL - } + { "Sequence Number", "msproxy.seq_num", FT_UINT8, + BASE_DEC, NULL, 0x0, NULL, HFILL + } }, { &hf_msproxy_rwsp_signature, - { "RWSP signature", "msproxy.rwsp_signature", FT_STRING, BASE_NONE, NULL, - 0x0, NULL, HFILL - } + { "RWSP signature", "msproxy.rwsp_signature", FT_STRING, BASE_NONE, NULL, + 0x0, NULL, HFILL + } }, { &hf_msproxy_ntlmssp_signature, - { "NTLMSSP signature", "msproxy.ntlmssp_signature", FT_STRING, BASE_NONE, NULL, - 0x0, NULL, HFILL - } + { "NTLMSSP signature", "msproxy.ntlmssp_signature", FT_STRING, BASE_NONE, NULL, + 0x0, NULL, HFILL + } }, }; static ei_register_info ei[] = { - { &ei_msproxy_unknown, { "msproxy.unknown", PI_UNDECODED, PI_WARN, "No know information (help wanted)", EXPFILL }}, - { &ei_msproxy_unhandled, { "msproxy.command.unhandled", PI_UNDECODED, PI_WARN, "Unhandled response command (report this, please)", EXPFILL }}, + { &ei_msproxy_unknown, + { "msproxy.unknown", PI_UNDECODED, PI_WARN, "No know information (help wanted)", EXPFILL }}, + { &ei_msproxy_unhandled, + { "msproxy.command.unhandled", PI_UNDECODED, PI_WARN, "Unhandled response command (report this, please)", EXPFILL }}, }; expert_module_t* expert_msproxy; @@ -1291,3 +1293,16 @@ proto_reg_handoff_msproxy(void) { proto_msproxy); dissector_add_uint("udp.port", UDP_PORT_MSPROXY, msproxy_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-netlink-sock_diag.c b/epan/dissectors/packet-netlink-sock_diag.c index 1d97575fb3..8e9d86be35 100644 --- a/epan/dissectors/packet-netlink-sock_diag.c +++ b/epan/dissectors/packet-netlink-sock_diag.c @@ -1211,3 +1211,16 @@ proto_reg_handoff_netlink_sock_diag(void) { dissector_add_uint("netlink.protocol", WS_NETLINK_SOCK_DIAG, netlink_sock_diag_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-nisplus.c b/epan/dissectors/packet-nisplus.c index edff55d14f..069ecd6815 100644 --- a/epan/dissectors/packet-nisplus.c +++ b/epan/dissectors/packet-nisplus.c @@ -1007,9 +1007,9 @@ static const value_string entry_type[] = { #define LOG_REM_NAME 2 { LOG_REM_NAME, "Name Was Removed" }, #define LOG_MOD_NAME_OLD 3 - { LOG_MOD_NAME_OLD, "Name Was Modified" }, + { LOG_MOD_NAME_OLD, "Name Was Modified" }, #define LOG_MOD_NAME_NEW 4 - { LOG_MOD_NAME_NEW, "Name Was Modified" }, + { LOG_MOD_NAME_NEW, "Name Was Modified" }, #define LOG_ADD_IBASE 5 { LOG_ADD_IBASE, "Entry Added To Information Base" }, #define LOG_REM_IBASE 6 @@ -1959,3 +1959,16 @@ proto_reg_handoff_niscb(void) /* Register the procedure tables */ rpc_init_proc_table(CB_PROGRAM, 1, cb1_proc, hf_nispluscb_procedure_v1); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-nlm.c b/epan/dissectors/packet-nlm.c index 413a717372..0d1e7a073f 100644 --- a/epan/dissectors/packet-nlm.c +++ b/epan/dissectors/packet-nlm.c @@ -409,7 +409,7 @@ dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, i static int dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, int version, rpc_call_info_value* rpc_call) + proto_tree *tree, int version, rpc_call_info_value* rpc_call) { if(nlm_match_msgres){ if(rpc_call->proc==6){ /* NLM_TEST_MSG */ @@ -435,7 +435,7 @@ dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree,int version, rpc_call_info_value* rpc_call) + proto_tree *tree,int version, rpc_call_info_value* rpc_call) { if(nlm_match_msgres){ if(rpc_call->proc==7){ /* NLM_LOCK_MSG */ @@ -463,7 +463,7 @@ dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree,int version, rpc_call_info_value* rpc_call) + proto_tree *tree,int version, rpc_call_info_value* rpc_call) { if(nlm_match_msgres){ if(rpc_call->proc==8){ /* NLM_CANCEL_MSG */ @@ -489,7 +489,7 @@ dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree,int version, rpc_call_info_value* rpc_call) + proto_tree *tree,int version, rpc_call_info_value* rpc_call) { if(nlm_match_msgres){ if(rpc_call->proc==9){ /* NLM_UNLOCK_MSG */ @@ -513,7 +513,7 @@ dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree,int version, rpc_call_info_value* rpc_call) + proto_tree *tree,int version, rpc_call_info_value* rpc_call) { if(nlm_match_msgres){ if(rpc_call->proc==10){ /* NLM_GRANTED_MSG */ @@ -539,7 +539,7 @@ dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, - proto_tree *tree, int version, rpc_call_info_value *rpc_call) + proto_tree *tree, int version, rpc_call_info_value *rpc_call) { proto_item* lock_item = NULL; proto_tree* lock_tree = NULL; @@ -611,7 +611,7 @@ dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, static int dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree,int version _U_, rpc_call_info_value* civ) + proto_tree *tree,int version _U_, rpc_call_info_value* civ) { proto_item* lock_item = NULL; proto_tree* lock_tree = NULL; @@ -645,7 +645,7 @@ dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, - proto_tree *tree, int version _U_) + proto_tree *tree, int version _U_) { guint32 nlm_stat; @@ -662,7 +662,7 @@ dissect_nlm_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, static int dissect_nlm_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, - proto_tree *tree,int version _U_) + proto_tree *tree,int version _U_) { guint32 nlm_stat; @@ -686,7 +686,7 @@ dissect_nlm_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, /* This function is identical for all NLM protocol versions (1-4)*/ static int dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { guint32 nlm_stat; @@ -722,14 +722,14 @@ dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, static int dissect_nlm1_test(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_test(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data); } static int dissect_nlm4_test(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_test(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data); } @@ -737,14 +737,14 @@ dissect_nlm4_test(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm1_lock(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_lock(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data); } static int dissect_nlm4_lock(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_lock(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data); } @@ -752,14 +752,14 @@ dissect_nlm4_lock(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm1_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_cancel(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data); } static int dissect_nlm4_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_cancel(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data); } @@ -767,14 +767,14 @@ dissect_nlm4_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm1_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_unlock(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data); } static int dissect_nlm4_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_unlock(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data); } @@ -782,14 +782,14 @@ dissect_nlm4_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm1_granted(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_granted(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data); } static int dissect_nlm4_granted(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_granted(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data); } @@ -797,56 +797,56 @@ dissect_nlm4_granted(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nlm1_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_test_res(tvb,offset,pinfo,tree,1,(rpc_call_info_value*)data); } static int dissect_nlm4_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data) + proto_tree *tree, void* data) { return dissect_nlm_test_res(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data); } static int dissect_nlm3_share(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data _U_) + proto_tree *tree, void* data _U_) { return dissect_nlm_share(tvb,offset,pinfo,tree,3,(rpc_call_info_value*)data); } static int dissect_nlm4_share(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data _U_) + proto_tree *tree, void* data _U_) { return dissect_nlm_share(tvb,offset,pinfo,tree,4,(rpc_call_info_value*)data); } static int dissect_nlm3_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data _U_) + proto_tree *tree, void* data _U_) { return dissect_nlm_shareres(tvb,offset,pinfo,tree,3); } static int dissect_nlm4_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data _U_) + proto_tree *tree, void* data _U_) { return dissect_nlm_shareres(tvb,offset,pinfo,tree,4); } static int dissect_nlm3_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data _U_) + proto_tree *tree, void* data _U_) { return dissect_nlm_freeall(tvb,offset,pinfo,tree,3); } static int dissect_nlm4_freeall(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, void* data _U_) + proto_tree *tree, void* data _U_) { return dissect_nlm_freeall(tvb,offset,pinfo,tree,4); } @@ -1238,3 +1238,16 @@ proto_reg_handoff_nlm(void) rpc_init_proc_table(NLM_PROGRAM, 3, nlm3_proc, hf_nlm_procedure_v3); rpc_init_proc_table(NLM_PROGRAM, 4, nlm4_proc, hf_nlm_procedure_v4); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-opsi.c b/epan/dissectors/packet-opsi.c index dbac25da3a..0ed77ccdf8 100644 --- a/epan/dissectors/packet-opsi.c +++ b/epan/dissectors/packet-opsi.c @@ -58,25 +58,25 @@ void proto_reg_handoff_opsi(void); /* Internal structure to dissect attributes */ typedef struct { - guint16 attribute_type; /* attribute code */ - const char *tree_text; /* text for fold out */ - gint *tree_id; /* id for add_item */ - int* hf_type_attribute; /* id for seach option */ - void (*dissect)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, - int* hfValue, int offset, int length); + guint16 attribute_type; /* attribute code */ + const char *tree_text; /* text for fold out */ + gint *tree_id; /* id for add_item */ + int *hf_type_attribute; /* id for seach option */ + void (*dissect)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, + int* hfValue, int offset, int length); } opsi_attribute_handle_t; /* Attributes codes */ -#define USER_NAME_ATTRIBUTE 1 -#define USER_PASSWD_ATTRIBUTE 2 -#define CHAP_PASSWD_ATTRIBUTE 3 -#define NAS_IP_ADDRESS_ATTRIBUTE 4 -#define NAS_PORT_ATTRIBUTE 5 -#define SERVICE_TYPE_ATTRIBUTE 6 -#define FRAMED_PROTOCOL_ATTRIBUTE 7 -#define FRAMED_ADDRESS_ATTRIBUTE 8 -#define FRAMED_NETMASK_ATTRIBUTE 9 +#define USER_NAME_ATTRIBUTE 1 +#define USER_PASSWD_ATTRIBUTE 2 +#define CHAP_PASSWD_ATTRIBUTE 3 +#define NAS_IP_ADDRESS_ATTRIBUTE 4 +#define NAS_PORT_ATTRIBUTE 5 +#define SERVICE_TYPE_ATTRIBUTE 6 +#define FRAMED_PROTOCOL_ATTRIBUTE 7 +#define FRAMED_ADDRESS_ATTRIBUTE 8 +#define FRAMED_NETMASK_ATTRIBUTE 9 #define FRAMED_ROUTING_ATTRIBUTE 10 #define FRAMED_FILTER_ATTRIBUTE 11 #define FRAMED_MTU_ATTRIBUTE 12 @@ -224,88 +224,88 @@ static expert_field ei_opsi_short_frame = EI_INIT; /* Code mapping */ static const value_string opsi_opcode[] = { - { DISCOVER_REQUEST, "Discover Request" }, - { DISCOVER_RESPONSE, "Discover Response" }, - { SERVICE_REQUEST, "Service Request" }, - { SERVICE_ACCEPT, "Service Accept" }, - { SERVICE_REJECT, "Service Reject" }, - { TERMINATE_REQUEST, "Terminate Request" }, - { 0, NULL } - }; + { DISCOVER_REQUEST, "Discover Request" }, + { DISCOVER_RESPONSE, "Discover Response" }, + { SERVICE_REQUEST, "Service Request" }, + { SERVICE_ACCEPT, "Service Accept" }, + { SERVICE_REJECT, "Service Reject" }, + { TERMINATE_REQUEST, "Terminate Request" }, + { 0, NULL } +}; static const value_string opsi_service_type_code[] = { - { 1, "Login" }, - { 2, "Framed" }, - { 3, "Callback Login" }, - { 4, "Callback Framed" }, - { 5, "Outbound" }, - { 6, "Administrative" }, - { 7, "NAS Prompt" }, - { 8, "Authenticate Only" }, - { 9, "Callback NAS Prompt" }, - { 0, NULL } - }; + { 1, "Login" }, + { 2, "Framed" }, + { 3, "Callback Login" }, + { 4, "Callback Framed" }, + { 5, "Outbound" }, + { 6, "Administrative" }, + { 7, "NAS Prompt" }, + { 8, "Authenticate Only" }, + { 9, "Callback NAS Prompt" }, + { 0, NULL } +}; static const value_string opsi_framed_protocol_code[] = { - { 1, "PPP" }, - { 2, "SLIP" }, - { 3, "AppleTalk Remote Access Protocol (ARAP)" }, - { 4, "Gandalf proprietary SingleLink/MultiLink protocol" }, - { 5, "Xylogics proprietary IPX/SLIP" }, - { 255, "Ascend ARA" }, - { 256, "MPP" }, - { 257, "EURAW" }, - { 258, "EUUI" }, - { 259, "X25" }, - { 260, "COMB" }, - { 261, "FR" }, - { 262, "MP" }, - { 263, "FR-CIR"}, - { 0, NULL } - }; + { 1, "PPP" }, + { 2, "SLIP" }, + { 3, "AppleTalk Remote Access Protocol (ARAP)" }, + { 4, "Gandalf proprietary SingleLink/MultiLink protocol" }, + { 5, "Xylogics proprietary IPX/SLIP" }, + { 255, "Ascend ARA" }, + { 256, "MPP" }, + { 257, "EURAW" }, + { 258, "EUUI" }, + { 259, "X25" }, + { 260, "COMB" }, + { 261, "FR" }, + { 262, "MP" }, + { 263, "FR-CIR"}, + { 0, NULL } +}; static const value_string opsi_framed_routing_code[] = { - { 0, "None" }, - { 1, "Broadcast" }, - { 2, "Listen" }, - { 3, "Broadcast-Listen" }, - { 4, "Broadcast V2" }, - { 5, "Listen V2" }, - { 6, "Broadcast-Listen V2" }, - { 0, NULL }, - }; + { 0, "None" }, + { 1, "Broadcast" }, + { 2, "Listen" }, + { 3, "Broadcast-Listen" }, + { 4, "Broadcast V2" }, + { 5, "Listen V2" }, + { 6, "Broadcast-Listen V2" }, + { 0, NULL }, +}; static const value_string opsi_framed_compression_code[] = { - { 0, "None" }, - { 1, "Van Jacobsen TCP/IP" }, - { 2, "IPX header compression" }, - { 0, NULL } - }; + { 0, "None" }, + { 1, "Van Jacobsen TCP/IP" }, + { 2, "IPX header compression" }, + { 0, NULL } +}; static const value_string opsi_nas_port_type_code[] = { - { 0, "Async" }, - { 1, "Sync" }, - { 2, "ISDN Sync" }, - { 3, "ISDN Async V.120" }, - { 4, "ISDN Async V.110" }, - { 5, "Virtual" }, - { 6, "PIAFS" }, - { 7, "HDLC Clear Channel" }, - { 8, "X.25" }, - { 9, "X.75" }, - { 10, "G.3 Fax" }, - { 11, "SDSL - Symmetric DSL" }, - { 12, "ADSL-CAP - Asymmetric DSL, Carrierless Amplitude Phase Modulation" }, - { 13, "ADSL-DMT - Asymmetric DSL, Discrete Multi-Tone" }, - { 14, "IDSL - ISDN Digital Subscriber Line" }, - { 15, "Ethernet" }, - { 16, "xDSL - Digital Subscriber Line of unknown type" }, - { 17, "Cable" }, - { 18, "Wireless - Other" }, - { 19, "Wireless - IEEE 802.11" }, - { 201,"Voice over IP" }, - { 0, NULL } - }; + { 0, "Async" }, + { 1, "Sync" }, + { 2, "ISDN Sync" }, + { 3, "ISDN Async V.120" }, + { 4, "ISDN Async V.110" }, + { 5, "Virtual" }, + { 6, "PIAFS" }, + { 7, "HDLC Clear Channel" }, + { 8, "X.25" }, + { 9, "X.75" }, + { 10, "G.3 Fax" }, + { 11, "SDSL - Symmetric DSL" }, + { 12, "ADSL-CAP - Asymmetric DSL, Carrierless Amplitude Phase Modulation" }, + { 13, "ADSL-DMT - Asymmetric DSL, Discrete Multi-Tone" }, + { 14, "IDSL - ISDN Digital Subscriber Line" }, + { 15, "Ethernet" }, + { 16, "xDSL - Digital Subscriber Line of unknown type" }, + { 17, "Cable" }, + { 18, "Wireless - Other" }, + { 19, "Wireless - IEEE 802.11" }, + { 201, "Voice over IP" }, + { 0, NULL } +}; /* Structure used to decode OPSI frame attributes */ @@ -314,111 +314,111 @@ static const value_string opsi_nas_port_type_code[] = { /* in ascending order */ /* */ static opsi_attribute_handle_t opsi_attributes[] = { - { USER_NAME_ATTRIBUTE, /* 1 */ - "User name attribute", &ett_opsi_user_name, &hf_user_name_att, decode_string_attribute }, - { USER_PASSWD_ATTRIBUTE, /* 2 */ - "User password attribute" , &ett_opsi_user_password, &hf_password_att, decode_string_attribute }, - { CHAP_PASSWD_ATTRIBUTE, /* 3 */ - "CHAP password attribute", &ett_opsi_chap_password, &hf_chap_password_att, decode_string_attribute }, - { NAS_IP_ADDRESS_ATTRIBUTE, /* 4 */ - "NAS IP address attribute", &ett_opsi_nas_ip_address, &hf_nas_ip_add_att, decode_ipv4_attribute }, - {NAS_PORT_ATTRIBUTE, /* 5 */ - "NAS port attribute", &ett_opsi_nas_port, &hf_nas_port_att, decode_longint_attribute }, - {SERVICE_TYPE_ATTRIBUTE, /* 6 */ - "Service type attribute", &ett_opsi_service_type, &hf_service_type_att, decode_value_string_attribute }, - {FRAMED_PROTOCOL_ATTRIBUTE, /* 7 */ - "Framed protocol attribute", &ett_opsi_framed_protocol, &hf_framed_protocol_att, decode_value_string_attribute }, - {FRAMED_ADDRESS_ATTRIBUTE, /* 8 */ - "Framed address attribute", &ett_opsi_framed_address, &hf_framed_address_att, decode_ipv4_attribute }, - {FRAMED_NETMASK_ATTRIBUTE, /* 9 */ - "Framed netmask attribute", &ett_opsi_framed_netmask, &hf_framed_netmask_att, decode_ipv4_attribute }, - {FRAMED_ROUTING_ATTRIBUTE, /* 10 */ - "Framed routing attribute", &ett_opsi_framed_routing, &hf_framed_routing_att, decode_value_string_attribute }, - {FRAMED_FILTER_ATTRIBUTE, /* 11 */ - "Framed filter attribute", &ett_opsi_framed_filter, &hf_framed_filter_att, decode_string_attribute }, - {FRAMED_MTU_ATTRIBUTE, /* 12 */ - "Framed MTU attribute", &ett_opsi_framed_mtu, &hf_framed_mtu_att, decode_longint_attribute }, - {FRAMED_COMPRESSION_ATTRIBUTE, /* 13 */ - "Framed compression attribute", &ett_opsi_framed_compression, &hf_framed_compression_att, decode_value_string_attribute }, - {CALLED_STATION_ID_ATTRIBUTE, /* 30 */ - "Called station ID attribute", &ett_opsi_called_station_id, &hf_called_station_att, decode_string_attribute }, - {CALLING_STATION_ID_ATTRIBUTE, /* 31 */ - "Calling station ID attribute", &ett_opsi_calling_station_id, &hf_calling_station_att, decode_string_attribute }, - {NAS_IDENTIFIER, /* 32 */ - "NAS Identifier attribute", &ett_opsi_nas_identifier, &hf_nas_identifier_att, decode_string_attribute }, - {ACCOUNTING_40_ATTRIBUTE, /* 40 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_41_ATTRIBUTE, /* 41 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_42_ATTRIBUTE, /* 42 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_43_ATTRIBUTE, /* 43 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_SESSION_ID_ATTRIBUTE, /* 44 */ + { USER_NAME_ATTRIBUTE, /* 1 */ + "User name attribute", &ett_opsi_user_name, &hf_user_name_att, decode_string_attribute }, + { USER_PASSWD_ATTRIBUTE, /* 2 */ + "User password attribute" , &ett_opsi_user_password, &hf_password_att, decode_string_attribute }, + { CHAP_PASSWD_ATTRIBUTE, /* 3 */ + "CHAP password attribute", &ett_opsi_chap_password, &hf_chap_password_att, decode_string_attribute }, + { NAS_IP_ADDRESS_ATTRIBUTE, /* 4 */ + "NAS IP address attribute", &ett_opsi_nas_ip_address, &hf_nas_ip_add_att, decode_ipv4_attribute }, + {NAS_PORT_ATTRIBUTE, /* 5 */ + "NAS port attribute", &ett_opsi_nas_port, &hf_nas_port_att, decode_longint_attribute }, + {SERVICE_TYPE_ATTRIBUTE, /* 6 */ + "Service type attribute", &ett_opsi_service_type, &hf_service_type_att, decode_value_string_attribute }, + {FRAMED_PROTOCOL_ATTRIBUTE, /* 7 */ + "Framed protocol attribute", &ett_opsi_framed_protocol, &hf_framed_protocol_att, decode_value_string_attribute }, + {FRAMED_ADDRESS_ATTRIBUTE, /* 8 */ + "Framed address attribute", &ett_opsi_framed_address, &hf_framed_address_att, decode_ipv4_attribute }, + {FRAMED_NETMASK_ATTRIBUTE, /* 9 */ + "Framed netmask attribute", &ett_opsi_framed_netmask, &hf_framed_netmask_att, decode_ipv4_attribute }, + {FRAMED_ROUTING_ATTRIBUTE, /* 10 */ + "Framed routing attribute", &ett_opsi_framed_routing, &hf_framed_routing_att, decode_value_string_attribute }, + {FRAMED_FILTER_ATTRIBUTE, /* 11 */ + "Framed filter attribute", &ett_opsi_framed_filter, &hf_framed_filter_att, decode_string_attribute }, + {FRAMED_MTU_ATTRIBUTE, /* 12 */ + "Framed MTU attribute", &ett_opsi_framed_mtu, &hf_framed_mtu_att, decode_longint_attribute }, + {FRAMED_COMPRESSION_ATTRIBUTE, /* 13 */ + "Framed compression attribute", &ett_opsi_framed_compression, &hf_framed_compression_att, decode_value_string_attribute }, + {CALLED_STATION_ID_ATTRIBUTE, /* 30 */ + "Called station ID attribute", &ett_opsi_called_station_id, &hf_called_station_att, decode_string_attribute }, + {CALLING_STATION_ID_ATTRIBUTE, /* 31 */ + "Calling station ID attribute", &ett_opsi_calling_station_id, &hf_calling_station_att, decode_string_attribute }, + {NAS_IDENTIFIER, /* 32 */ + "NAS Identifier attribute", &ett_opsi_nas_identifier, &hf_nas_identifier_att, decode_string_attribute }, + {ACCOUNTING_40_ATTRIBUTE, /* 40 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_41_ATTRIBUTE, /* 41 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_42_ATTRIBUTE, /* 42 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_43_ATTRIBUTE, /* 43 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_SESSION_ID_ATTRIBUTE, /* 44 */ "Accounting session ID attribute", &ett_opsi_acct_session_id, &hf_acct_session_id_att, decode_string_attribute }, - {ACCOUNTING_45_ATTRIBUTE, /* 45 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_46_ATTRIBUTE, /* 46 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_47_ATTRIBUTE, /* 47 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_48_ATTRIBUTE, /* 48 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_49_ATTRIBUTE, /* 49 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_50_ATTRIBUTE, /* 50 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_51_ATTRIBUTE, /* 51 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_52_ATTRIBUTE, /* 52 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_53_ATTRIBUTE, /* 53 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_54_ATTRIBUTE, /* 54 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_55_ATTRIBUTE, /* 55 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_56_ATTRIBUTE, /* 56 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_57_ATTRIBUTE, /* 57 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_58_ATTRIBUTE, /* 58 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {ACCOUNTING_59_ATTRIBUTE, /* 59 */ - "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, - {CHAP_CHALLENGE_ATTRIBUTE, /* 60 */ - "CHAP challenge", &ett_opsi_chap_challenge, &hf_chap_challenge_att, decode_string_attribute }, - {NAS_PORT_TYPE_ATTRIBUTE, /* 61 */ - "NAS port type attribute", &ett_opsi_nas_port_type, &hf_nas_port_type_att, decode_value_string_attribute }, - {DESIGNATION_NUMBER_ATTRIBUTE, /* 77 */ - "Designation number attribute", &ett_opsi_designation_number, &hf_designation_num_att, decode_string_attribute }, - {NAS_PORT_ID_ATTRIBUTE, /* 87 */ - "NAS port ID attribute", &ett_opsi_nas_port_id, &hf_nas_port_id_att, decode_string_attribute }, - {SMC_AAAID_ATTRIBUTE, /* 651 */ - "SMC AAA ID attribute", &ett_opsi_smc_aaa_id, &hf_smc_aaa_id_att, decode_longint_attribute }, - {SMC_VPNID_ATTRIBUTE, /* 652 */ - "SMC VPN ID attribute", &ett_opsi_smc_vpn_id, &hf_smc_vpn_id_att, decode_longint_attribute }, - {SMC_VPNNAME_ATTRIBUTE, /* 653 */ - "SMC VPN name attribute", &ett_opsi_smc_vpn_name, &hf_smc_vpn_name_att, decode_string_attribute }, - {SMC_RANID_ATTRIBUTE, /* 654 */ - "SMC RAN ID attribute", &ett_opsi_smc_ran_id, &hf_smc_ran_id_att, decode_longint_attribute }, - {SMC_RANIP_ATTRIBUTE, /* 655 */ - "SMC RAN IP attribute", &ett_opsi_smc_ran_ip, &hf_smc_ran_ip_att, decode_ipv4_attribute }, - {SMC_RANNAME_ATTRIBUTE, /* 656 */ - "SMC RAN name attribute", &ett_opsi_smc_ran_name, &hf_smc_ran_name_att, decode_string_attribute }, - {SMC_POPID_ATTRIBUTE, /* 657 */ - "SMC POP ID attribute", &ett_opsi_smc_pop_id, &hf_smc_pop_id_att, decode_longint_attribute }, - {SMC_POPNAME_ATTRIBUTE, /* 658 */ - "SMC POP name attribute", &ett_opsi_smc_pop_name, &hf_smc_pop_name_att, decode_string_attribute }, - {SMC_SMCID_ATTRIBUTE, /* 659 */ - "SMC ID attribute", &ett_opsi_smc_id, &hf_smc_id_att, decode_longint_attribute }, - {SMC_RECEIVE_TIME_ATTRIBUTE, /* 660 */ - "SMC receive time attribute", &ett_opsi_smc_receive_time, &hf_smc_receive_time_att, decode_time_attribute }, - {SMC_STAT_TIME_ATTRIBUTE, /* 661 */ - "SMC stat time attribute", &ett_opsi_smc_stat_time, &hf_smc_stat_time_att, decode_longint_attribute }, - {OPSI_FLAGS_ATTRIBUTE, /* 674 */ - "OPSI flags attribute", &ett_opsi_flags, &hf_opsi_flags_att, decode_longint_attribute }, - {OPSI_APPLICATION_NAME_ATTRIBUTE,/* 675 */ + {ACCOUNTING_45_ATTRIBUTE, /* 45 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_46_ATTRIBUTE, /* 46 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_47_ATTRIBUTE, /* 47 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_48_ATTRIBUTE, /* 48 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_49_ATTRIBUTE, /* 49 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_50_ATTRIBUTE, /* 50 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_51_ATTRIBUTE, /* 51 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_52_ATTRIBUTE, /* 52 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_53_ATTRIBUTE, /* 53 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_54_ATTRIBUTE, /* 54 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_55_ATTRIBUTE, /* 55 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_56_ATTRIBUTE, /* 56 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_57_ATTRIBUTE, /* 57 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_58_ATTRIBUTE, /* 58 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {ACCOUNTING_59_ATTRIBUTE, /* 59 */ + "Accounting attribute", &ett_opsi_accounting, &hf_accounting_att, decode_string_attribute }, + {CHAP_CHALLENGE_ATTRIBUTE, /* 60 */ + "CHAP challenge", &ett_opsi_chap_challenge, &hf_chap_challenge_att, decode_string_attribute }, + {NAS_PORT_TYPE_ATTRIBUTE, /* 61 */ + "NAS port type attribute", &ett_opsi_nas_port_type, &hf_nas_port_type_att, decode_value_string_attribute }, + {DESIGNATION_NUMBER_ATTRIBUTE, /* 77 */ + "Designation number attribute", &ett_opsi_designation_number, &hf_designation_num_att, decode_string_attribute }, + {NAS_PORT_ID_ATTRIBUTE, /* 87 */ + "NAS port ID attribute", &ett_opsi_nas_port_id, &hf_nas_port_id_att, decode_string_attribute }, + {SMC_AAAID_ATTRIBUTE, /* 651 */ + "SMC AAA ID attribute", &ett_opsi_smc_aaa_id, &hf_smc_aaa_id_att, decode_longint_attribute }, + {SMC_VPNID_ATTRIBUTE, /* 652 */ + "SMC VPN ID attribute", &ett_opsi_smc_vpn_id, &hf_smc_vpn_id_att, decode_longint_attribute }, + {SMC_VPNNAME_ATTRIBUTE, /* 653 */ + "SMC VPN name attribute", &ett_opsi_smc_vpn_name, &hf_smc_vpn_name_att, decode_string_attribute }, + {SMC_RANID_ATTRIBUTE, /* 654 */ + "SMC RAN ID attribute", &ett_opsi_smc_ran_id, &hf_smc_ran_id_att, decode_longint_attribute }, + {SMC_RANIP_ATTRIBUTE, /* 655 */ + "SMC RAN IP attribute", &ett_opsi_smc_ran_ip, &hf_smc_ran_ip_att, decode_ipv4_attribute }, + {SMC_RANNAME_ATTRIBUTE, /* 656 */ + "SMC RAN name attribute", &ett_opsi_smc_ran_name, &hf_smc_ran_name_att, decode_string_attribute }, + {SMC_POPID_ATTRIBUTE, /* 657 */ + "SMC POP ID attribute", &ett_opsi_smc_pop_id, &hf_smc_pop_id_att, decode_longint_attribute }, + {SMC_POPNAME_ATTRIBUTE, /* 658 */ + "SMC POP name attribute", &ett_opsi_smc_pop_name, &hf_smc_pop_name_att, decode_string_attribute }, + {SMC_SMCID_ATTRIBUTE, /* 659 */ + "SMC ID attribute", &ett_opsi_smc_id, &hf_smc_id_att, decode_longint_attribute }, + {SMC_RECEIVE_TIME_ATTRIBUTE, /* 660 */ + "SMC receive time attribute", &ett_opsi_smc_receive_time, &hf_smc_receive_time_att, decode_time_attribute }, + {SMC_STAT_TIME_ATTRIBUTE, /* 661 */ + "SMC stat time attribute", &ett_opsi_smc_stat_time, &hf_smc_stat_time_att, decode_longint_attribute }, + {OPSI_FLAGS_ATTRIBUTE, /* 674 */ + "OPSI flags attribute", &ett_opsi_flags, &hf_opsi_flags_att, decode_longint_attribute }, + {OPSI_APPLICATION_NAME_ATTRIBUTE, /* 675 */ "OPSI application name attribute", &ett_opsi_application_name, &hf_opsi_application_name_att, decode_string_attribute }, }; @@ -890,3 +890,16 @@ proto_reg_handoff_opsi(void) opsi_handle = new_create_dissector_handle(dissect_opsi, proto_opsi); dissector_add_uint("tcp.port", TCP_PORT_OPSI, opsi_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-pgm.c b/epan/dissectors/packet-pgm.c index 775571d1a0..c787ca122e 100644 --- a/epan/dissectors/packet-pgm.c +++ b/epan/dissectors/packet-pgm.c @@ -310,23 +310,23 @@ paritystr(guint8 parity) } static const value_string opt_vals[] = { - { PGM_OPT_LENGTH, "Length" }, - { PGM_OPT_END, "End" }, - { PGM_OPT_FRAGMENT, "Fragment" }, - { PGM_OPT_NAK_LIST, "NakList" }, - { PGM_OPT_JOIN, "Join" }, - { PGM_OPT_REDIRECT, "ReDirect" }, - { PGM_OPT_SYN, "Syn" }, - { PGM_OPT_FIN, "Fin" }, - { PGM_OPT_RST, "Rst" }, - { PGM_OPT_PARITY_PRM, "ParityPrm" }, - { PGM_OPT_PARITY_GRP, "ParityGrp" }, - { PGM_OPT_CURR_TGSIZE, "CurrTgsiz" }, - { PGM_OPT_PGMCC_DATA, "CcData" }, + { PGM_OPT_LENGTH, "Length" }, + { PGM_OPT_END, "End" }, + { PGM_OPT_FRAGMENT, "Fragment" }, + { PGM_OPT_NAK_LIST, "NakList" }, + { PGM_OPT_JOIN, "Join" }, + { PGM_OPT_REDIRECT, "ReDirect" }, + { PGM_OPT_SYN, "Syn" }, + { PGM_OPT_FIN, "Fin" }, + { PGM_OPT_RST, "Rst" }, + { PGM_OPT_PARITY_PRM, "ParityPrm" }, + { PGM_OPT_PARITY_GRP, "ParityGrp" }, + { PGM_OPT_CURR_TGSIZE, "CurrTgsiz" }, + { PGM_OPT_PGMCC_DATA, "CcData" }, { PGM_OPT_PGMCC_FEEDBACK, "CcFeedBack" }, - { PGM_OPT_NAK_BO_IVL, "NakBackOffIvl" }, - { PGM_OPT_NAK_BO_RNG, "NakBackOffRng" }, - { PGM_OPT_FRAGMENT, "Fragment" }, + { PGM_OPT_NAK_BO_IVL, "NakBackOffIvl" }, + { PGM_OPT_NAK_BO_RNG, "NakBackOffRng" }, + { PGM_OPT_FRAGMENT, "Fragment" }, { 0, NULL } }; @@ -363,15 +363,15 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) { proto_item *tf, *ti, *ti_len; proto_tree *opts_tree = NULL; - proto_tree *opt_tree = NULL; - tvbuff_t *tvb = ptvcursor_tvbuff(cursor); + proto_tree *opt_tree = NULL; + tvbuff_t *tvb = ptvcursor_tvbuff(cursor); gboolean theend = FALSE; guint16 opts_total_len; - guint8 genopts_type; - guint8 genopts_len; - guint8 opts_type; + guint8 genopts_type; + guint8 genopts_len; + guint8 opts_type; opts_tree = proto_tree_add_subtree_format(ptvcursor_tree(cursor), tvb, ptvcursor_current_offset(cursor), -1, ett_pgm_opts, &tf, "%s Options", pktname); @@ -415,7 +415,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) switch(genopts_type) { case PGM_OPT_JOIN:{ - TLV_CHECK(ett_pgm_opts_join); + TLV_CHECK(ett_pgm_opts_join); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -438,7 +438,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) case PGM_OPT_PARITY_PRM:{ guint8 optdata_po; - TLV_CHECK(ett_pgm_opts_parityprm); + TLV_CHECK(ett_pgm_opts_parityprm); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -465,7 +465,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) break; } case PGM_OPT_PARITY_GRP:{ - TLV_CHECK(ett_pgm_opts_paritygrp); + TLV_CHECK(ett_pgm_opts_paritygrp); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -492,7 +492,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) gboolean firsttime; int i, j, naks, soffset; - TLV_CHECK(ett_pgm_opts_naklist); + TLV_CHECK(ett_pgm_opts_naklist); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -551,7 +551,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) case PGM_OPT_PGMCC_DATA:{ guint16 optdata_afi; - TLV_CHECK(ett_pgm_opts_ccdata); + TLV_CHECK(ett_pgm_opts_ccdata); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -592,7 +592,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) case PGM_OPT_PGMCC_FEEDBACK:{ guint16 optdata_afi; - TLV_CHECK(ett_pgm_opts_ccdata); + TLV_CHECK(ett_pgm_opts_ccdata); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -631,7 +631,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) break; } case PGM_OPT_NAK_BO_IVL:{ - TLV_CHECK(ett_pgm_opts_nak_bo_ivl); + TLV_CHECK(ett_pgm_opts_nak_bo_ivl); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -653,7 +653,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) break; } case PGM_OPT_NAK_BO_RNG:{ - TLV_CHECK(ett_pgm_opts_nak_bo_rng); + TLV_CHECK(ett_pgm_opts_nak_bo_rng); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -677,7 +677,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) case PGM_OPT_REDIRECT:{ guint16 optdata_afi; - TLV_CHECK(ett_pgm_opts_redirect); + TLV_CHECK(ett_pgm_opts_redirect); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -715,7 +715,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) break; } case PGM_OPT_FRAGMENT:{ - TLV_CHECK(ett_pgm_opts_fragment); + TLV_CHECK(ett_pgm_opts_fragment); ptvcursor_set_tree(cursor, opt_tree); ptvcursor_add_no_advance(cursor, hf_pgm_genopt_end, 1, ENC_BIG_ENDIAN); @@ -738,7 +738,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) break; } default:{ - TLV_CHECK(ett_pgm_opts); + TLV_CHECK(ett_pgm_opts); ptvcursor_advance(cursor, genopts_len); break; } @@ -774,31 +774,31 @@ static const value_string poll_subtype_vals[] = { static void decode_pgm_ports(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, guint16 pgmhdr_sport, guint16 pgmhdr_dport) + proto_tree *tree, guint16 pgmhdr_sport, guint16 pgmhdr_dport) { - tvbuff_t *next_tvb; - int found = 0; - heur_dtbl_entry_t *hdtbl_entry; + tvbuff_t *next_tvb; + int found = 0; + heur_dtbl_entry_t *hdtbl_entry; - next_tvb = tvb_new_subset_remaining(tvb, offset); + next_tvb = tvb_new_subset_remaining(tvb, offset); - /* do lookup with the subdissector table */ - found = dissector_try_uint(subdissector_table, pgmhdr_sport, - next_tvb, pinfo, tree); - if (found) - return; + /* do lookup with the subdissector table */ + found = dissector_try_uint(subdissector_table, pgmhdr_sport, + next_tvb, pinfo, tree); + if (found) + return; - found = dissector_try_uint(subdissector_table, pgmhdr_dport, - next_tvb, pinfo, tree); - if (found) - return; + found = dissector_try_uint(subdissector_table, pgmhdr_dport, + next_tvb, pinfo, tree); + if (found) + return; - /* do lookup with the heuristic subdissector table */ - if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) - return; + /* do lookup with the heuristic subdissector table */ + if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) + return; - /* Oh, well, we don't know this; dissect it as data. */ - call_dissector(data_handle,next_tvb, pinfo, tree); + /* Oh, well, we don't know this; dissect it as data. */ + call_dissector(data_handle,next_tvb, pinfo, tree); } /* @@ -809,20 +809,20 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint16 pgmhdr_sport; guint16 pgmhdr_dport; - guint8 pgmhdr_type; - guint8 pgmhdr_opts; + guint8 pgmhdr_type; + guint8 pgmhdr_opts; guint16 pgmhdr_cksum; guint16 pgmhdr_tsdulen; guint32 sqn; guint16 afi; - guint plen = 0; + guint plen = 0; proto_item *ti; const char *pktname; const char *pollstname; - char *gsi; - gboolean isdata = FALSE; - guint pgmlen, reportedlen; + char *gsi; + gboolean isdata = FALSE; + guint pgmlen, reportedlen; col_set_str(pinfo->cinfo, COL_PROTOCOL, "PGM"); @@ -1093,349 +1093,349 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) void proto_register_pgm(void) { - static hf_register_info hf[] = { - { &hf_pgm_main_sport, - { "Source Port", "pgm.hdr.sport", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_main_dport, - { "Destination Port", "pgm.hdr.dport", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_port, - { "Port", "pgm.port", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_main_type, - { "Type", "pgm.hdr.type", FT_UINT8, BASE_HEX, - VALS(type_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_main_opts, - { "Options", "pgm.hdr.opts", FT_UINT8, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_main_opts_opt, - { "Options", "pgm.hdr.opts.opt", FT_BOOLEAN, 8, - TFS(&opts_present), PGM_OPT, NULL, HFILL }}, - { &hf_pgm_main_opts_netsig, - { "Network Significant Options", "pgm.hdr.opts.netsig", - FT_BOOLEAN, 8, - TFS(&opts_present), PGM_OPT_NETSIG, NULL, HFILL }}, - { &hf_pgm_main_opts_varlen, - { "Variable length Parity Packet Option", "pgm.hdr.opts.varlen", - FT_BOOLEAN, 8, - TFS(&opts_present), PGM_OPT_VAR_PKTLEN, NULL, HFILL }}, - { &hf_pgm_main_opts_parity, - { "Parity", "pgm.hdr.opts.parity", FT_BOOLEAN, 8, - TFS(&opts_present), PGM_OPT_PARITY, NULL, HFILL }}, - { &hf_pgm_main_cksum, - { "Checksum", "pgm.hdr.cksum", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_main_cksum_bad, - { "Bad Checksum", "pgm.hdr.cksum_bad", FT_BOOLEAN, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_main_gsi, - { "Global Source Identifier", "pgm.hdr.gsi", FT_BYTES, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_main_tsdulen, - { "Transport Service Data Unit Length", "pgm.hdr.tsdulen", FT_UINT16, - BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_spm_sqn, - { "Sequence number", "pgm.spm.sqn", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_spm_trail, - { "Trailing Edge Sequence Number", "pgm.spm.trail", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_spm_lead, - { "Leading Edge Sequence Number", "pgm.spm.lead", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_spm_pathafi, - { "Path NLA AFI", "pgm.spm.pathafi", FT_UINT16, BASE_DEC, - VALS(afn_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_spm_res, - { "Reserved", "pgm.spm.res", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_spm_path, - { "Path NLA", "pgm.spm.path", FT_IPv4, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_spm_path6, - { "Path NLA", "pgm.spm.path", FT_IPv6, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, + static hf_register_info hf[] = { + { &hf_pgm_main_sport, + { "Source Port", "pgm.hdr.sport", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_main_dport, + { "Destination Port", "pgm.hdr.dport", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_port, + { "Port", "pgm.port", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_main_type, + { "Type", "pgm.hdr.type", FT_UINT8, BASE_HEX, + VALS(type_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_main_opts, + { "Options", "pgm.hdr.opts", FT_UINT8, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_main_opts_opt, + { "Options", "pgm.hdr.opts.opt", FT_BOOLEAN, 8, + TFS(&opts_present), PGM_OPT, NULL, HFILL }}, + { &hf_pgm_main_opts_netsig, + { "Network Significant Options", "pgm.hdr.opts.netsig", + FT_BOOLEAN, 8, + TFS(&opts_present), PGM_OPT_NETSIG, NULL, HFILL }}, + { &hf_pgm_main_opts_varlen, + { "Variable length Parity Packet Option", "pgm.hdr.opts.varlen", + FT_BOOLEAN, 8, + TFS(&opts_present), PGM_OPT_VAR_PKTLEN, NULL, HFILL }}, + { &hf_pgm_main_opts_parity, + { "Parity", "pgm.hdr.opts.parity", FT_BOOLEAN, 8, + TFS(&opts_present), PGM_OPT_PARITY, NULL, HFILL }}, + { &hf_pgm_main_cksum, + { "Checksum", "pgm.hdr.cksum", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_main_cksum_bad, + { "Bad Checksum", "pgm.hdr.cksum_bad", FT_BOOLEAN, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_main_gsi, + { "Global Source Identifier", "pgm.hdr.gsi", FT_BYTES, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_main_tsdulen, + { "Transport Service Data Unit Length", "pgm.hdr.tsdulen", FT_UINT16, + BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_spm_sqn, + { "Sequence number", "pgm.spm.sqn", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_spm_trail, + { "Trailing Edge Sequence Number", "pgm.spm.trail", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_spm_lead, + { "Leading Edge Sequence Number", "pgm.spm.lead", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_spm_pathafi, + { "Path NLA AFI", "pgm.spm.pathafi", FT_UINT16, BASE_DEC, + VALS(afn_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_spm_res, + { "Reserved", "pgm.spm.res", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_spm_path, + { "Path NLA", "pgm.spm.path", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_spm_path6, + { "Path NLA", "pgm.spm.path", FT_IPv6, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, #if 0 - { &hf_pgm_data_sqn, - { "Data Packet Sequence Number", "pgm.data.sqn", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_data_sqn, + { "Data Packet Sequence Number", "pgm.data.sqn", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, #endif #if 0 - { &hf_pgm_data_trail, - { "Trailing Edge Sequence Number", "pgm.data.trail", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_data_trail, + { "Trailing Edge Sequence Number", "pgm.data.trail", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, #endif - { &hf_pgm_nak_sqn, - { "Requested Sequence Number", "pgm.nak.sqn", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_nak_srcafi, - { "Source NLA AFI", "pgm.nak.srcafi", FT_UINT16, BASE_DEC, - VALS(afn_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_nak_srcres, - { "Reserved", "pgm.nak.srcres", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_nak_src, - { "Source NLA", "pgm.nak.src", FT_IPv4, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_nak_src6, - { "Source NLA", "pgm.nak.src", FT_IPv6, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_nak_grpafi, - { "Multicast Group AFI", "pgm.nak.grpafi", FT_UINT16, BASE_DEC, - VALS(afn_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_nak_grpres, - { "Reserved", "pgm.nak.grpres", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_nak_grp, - { "Multicast Group NLA", "pgm.nak.grp", FT_IPv4, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_nak_grp6, - { "Multicast Group NLA", "pgm.nak.grp", FT_IPv6, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_poll_sqn, - { "Sequence Number", "pgm.poll.sqn", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_poll_round, - { "Round", "pgm.poll.round", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_poll_subtype, - { "Subtype", "pgm.poll.subtype", FT_UINT16, BASE_HEX, - VALS(poll_subtype_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_poll_pathafi, - { "Path NLA AFI", "pgm.poll.pathafi", FT_UINT16, BASE_DEC, - VALS(afn_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_poll_res, - { "Reserved", "pgm.poll.res", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_poll_path, - { "Path NLA", "pgm.poll.path", FT_IPv4, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_poll_path6, - { "Path NLA", "pgm.poll.path", FT_IPv6, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_poll_backoff_ivl, - { "Back-off Interval", "pgm.poll.backoff_ivl", FT_UINT32, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_poll_rand_str, - { "Random String", "pgm.poll.rand_str", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_poll_matching_bmask, - { "Matching Bitmask", "pgm.poll.matching_bmask", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_polr_sqn, - { "Sequence Number", "pgm.polr.sqn", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_polr_round, - { "Round", "pgm.polr.round", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_polr_res, - { "Reserved", "pgm.polr.res", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_ack_sqn, - { "Maximum Received Sequence Number", "pgm.ack.maxsqn", FT_UINT32, - BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_ack_bitmap, - { "Packet Bitmap", "pgm.ack.bitmap", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_type, - { "Type", "pgm.opts.type", FT_UINT8, BASE_HEX, - VALS(opt_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_opt_len, - { "Length", "pgm.opts.len", FT_UINT8, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_tlen, - { "Total Length", "pgm.opts.tlen", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_genopt_end, - { "Option end", "pgm.genopts.end", FT_BOOLEAN, 8, - TFS(&tfs_yes_no), 0x80, NULL, HFILL }}, - { &hf_pgm_genopt_type, - { "Type", "pgm.genopts.type", FT_UINT8, BASE_HEX, - VALS(opt_vals), 0x7f, NULL, HFILL }}, - { &hf_pgm_genopt_len, - { "Length", "pgm.genopts.len", FT_UINT8, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_genopt_opx, - { "Option Extensibility Bits", "pgm.genopts.opx", FT_UINT8, BASE_HEX, - VALS(opx_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_opt_parity_prm_po, - { "Parity Parameters", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_parity_prm_prmtgsz, - { "Transmission Group Size", "pgm.opts.parity_prm.prm_grp", - FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_join_res, - { "Reserved", "pgm.opts.join.res", FT_UINT8, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_join_minjoin, - { "Minimum Sequence Number", "pgm.opts.join.min_join", - FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_parity_grp_res, - { "Reserved", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_parity_grp_prmgrp, - { "Transmission Group Size", "pgm.opts.parity_prm.prm_grp", - FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_nak_res, - { "Reserved", "pgm.opts.nak.op", FT_UINT8, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_nak_list, - { "List", "pgm.opts.nak.list", FT_BYTES, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccdata_res, - { "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccdata_tsp, - { "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccdata_afi, - { "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC, - VALS(afn_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccdata_res2, - { "Reserved", "pgm.opts.ccdata.res2", FT_UINT16, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccdata_acker, - { "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccdata_acker6, - { "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccfeedbk_res, - { "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccfeedbk_tsp, - { "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccfeedbk_afi, - { "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC, - VALS(afn_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccfeedbk_lossrate, - { "Loss Rate", "pgm.opts.ccdata.lossrate", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccfeedbk_acker, - { "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_ccfeedbk_acker6, - { "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_nak_bo_ivl_res, - { "Reserved", "pgm.opts.nak_bo_ivl.res", FT_UINT8, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_nak_bo_ivl_bo_ivl, - { "Back-off Interval", "pgm.opts.nak_bo_ivl.bo_ivl", FT_UINT32, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_nak_bo_ivl_bo_ivl_sqn, - { "Back-off Interval Sequence Number", "pgm.opts.nak_bo_ivl.bo_ivl_sqn", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_nak_bo_rng_res, - { "Reserved", "pgm.opts.nak_bo_rng.res", FT_UINT8, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_nak_bo_rng_min_bo_ivl, - { "Min Back-off Interval", "pgm.opts.nak_bo_rng.min_bo_ivl", FT_UINT32, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_nak_bo_rng_max_bo_ivl, - { "Max Back-off Interval", "pgm.opts.nak_bo_rng.max_bo_ivl", FT_UINT32, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_redirect_res, - { "Reserved", "pgm.opts.redirect.res", FT_UINT8, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_redirect_afi, - { "DLR AFI", "pgm.opts.redirect.afi", FT_UINT16, BASE_DEC, - VALS(afn_vals), 0x0, NULL, HFILL }}, - { &hf_pgm_opt_redirect_res2, - { "Reserved", "pgm.opts.redirect.res2", FT_UINT16, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_redirect_dlr, - { "DLR", "pgm.opts.redirect.dlr", FT_IPv4, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_redirect_dlr6, - { "DLR", "pgm.opts.redirect.dlr", FT_IPv6, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_fragment_res, - { "Reserved", "pgm.opts.fragment.res", FT_UINT8, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_fragment_first_sqn, - { "First Sequence Number", "pgm.opts.fragment.first_sqn", FT_UINT32, BASE_HEX, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_fragment_offset, - { "Fragment Offset", "pgm.opts.fragment.fragment_offset", FT_UINT32, BASE_DEC, - NULL, 0x0, NULL, HFILL }}, - { &hf_pgm_opt_fragment_total_length, - { "Total Length", "pgm.opts.fragment.total_length", FT_UINT32, BASE_DEC, - NULL, 0x0, NULL, HFILL }} - }; - static gint *ett[] = { - &ett_pgm, - &ett_pgm_optbits, - &ett_pgm_spm, - &ett_pgm_data, - &ett_pgm_nak, - &ett_pgm_poll, - &ett_pgm_polr, - &ett_pgm_ack, - &ett_pgm_opts, - &ett_pgm_opts_join, - &ett_pgm_opts_parityprm, - &ett_pgm_opts_paritygrp, - &ett_pgm_opts_naklist, - &ett_pgm_opts_ccdata, - &ett_pgm_opts_nak_bo_ivl, - &ett_pgm_opts_nak_bo_rng, - &ett_pgm_opts_redirect, - &ett_pgm_opts_fragment - }; - static ei_register_info ei[] = { - { &ei_pgm_opt_type, { "pgm.opts.type.invalid", PI_PROTOCOL, PI_WARN, "Invalid option", EXPFILL }}, - { &ei_pgm_opt_tlen, { "pgm.opts.tlen.invalid", PI_PROTOCOL, PI_WARN, "Total Length invalid", EXPFILL }}, - { &ei_pgm_genopt_len, { "pgm.genopts.len.invalid", PI_PROTOCOL, PI_WARN, "Option length invalid", EXPFILL }}, - { &ei_address_format_invalid, { "pgm.address_format_invalid", PI_PROTOCOL, PI_WARN, "Can't handle this address format", EXPFILL }}, - }; - - module_t *pgm_module; - expert_module_t* expert_pgm; - - proto_pgm = proto_register_protocol("Pragmatic General Multicast", - "PGM", "pgm"); - - proto_register_field_array(proto_pgm, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - expert_pgm = expert_register_protocol(proto_pgm); - expert_register_field_array(expert_pgm, ei, array_length(ei)); + { &hf_pgm_nak_sqn, + { "Requested Sequence Number", "pgm.nak.sqn", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_nak_srcafi, + { "Source NLA AFI", "pgm.nak.srcafi", FT_UINT16, BASE_DEC, + VALS(afn_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_nak_srcres, + { "Reserved", "pgm.nak.srcres", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_nak_src, + { "Source NLA", "pgm.nak.src", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_nak_src6, + { "Source NLA", "pgm.nak.src", FT_IPv6, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_nak_grpafi, + { "Multicast Group AFI", "pgm.nak.grpafi", FT_UINT16, BASE_DEC, + VALS(afn_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_nak_grpres, + { "Reserved", "pgm.nak.grpres", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_nak_grp, + { "Multicast Group NLA", "pgm.nak.grp", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_nak_grp6, + { "Multicast Group NLA", "pgm.nak.grp", FT_IPv6, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_poll_sqn, + { "Sequence Number", "pgm.poll.sqn", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_poll_round, + { "Round", "pgm.poll.round", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_poll_subtype, + { "Subtype", "pgm.poll.subtype", FT_UINT16, BASE_HEX, + VALS(poll_subtype_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_poll_pathafi, + { "Path NLA AFI", "pgm.poll.pathafi", FT_UINT16, BASE_DEC, + VALS(afn_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_poll_res, + { "Reserved", "pgm.poll.res", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_poll_path, + { "Path NLA", "pgm.poll.path", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_poll_path6, + { "Path NLA", "pgm.poll.path", FT_IPv6, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_poll_backoff_ivl, + { "Back-off Interval", "pgm.poll.backoff_ivl", FT_UINT32, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_poll_rand_str, + { "Random String", "pgm.poll.rand_str", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_poll_matching_bmask, + { "Matching Bitmask", "pgm.poll.matching_bmask", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_polr_sqn, + { "Sequence Number", "pgm.polr.sqn", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_polr_round, + { "Round", "pgm.polr.round", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_polr_res, + { "Reserved", "pgm.polr.res", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_ack_sqn, + { "Maximum Received Sequence Number", "pgm.ack.maxsqn", FT_UINT32, + BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_ack_bitmap, + { "Packet Bitmap", "pgm.ack.bitmap", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_type, + { "Type", "pgm.opts.type", FT_UINT8, BASE_HEX, + VALS(opt_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_opt_len, + { "Length", "pgm.opts.len", FT_UINT8, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_tlen, + { "Total Length", "pgm.opts.tlen", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_genopt_end, + { "Option end", "pgm.genopts.end", FT_BOOLEAN, 8, + TFS(&tfs_yes_no), 0x80, NULL, HFILL }}, + { &hf_pgm_genopt_type, + { "Type", "pgm.genopts.type", FT_UINT8, BASE_HEX, + VALS(opt_vals), 0x7f, NULL, HFILL }}, + { &hf_pgm_genopt_len, + { "Length", "pgm.genopts.len", FT_UINT8, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_genopt_opx, + { "Option Extensibility Bits", "pgm.genopts.opx", FT_UINT8, BASE_HEX, + VALS(opx_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_opt_parity_prm_po, + { "Parity Parameters", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_parity_prm_prmtgsz, + { "Transmission Group Size", "pgm.opts.parity_prm.prm_grp", + FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_join_res, + { "Reserved", "pgm.opts.join.res", FT_UINT8, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_join_minjoin, + { "Minimum Sequence Number", "pgm.opts.join.min_join", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_parity_grp_res, + { "Reserved", "pgm.opts.parity_prm.op", FT_UINT8, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_parity_grp_prmgrp, + { "Transmission Group Size", "pgm.opts.parity_prm.prm_grp", + FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_nak_res, + { "Reserved", "pgm.opts.nak.op", FT_UINT8, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_nak_list, + { "List", "pgm.opts.nak.list", FT_BYTES, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccdata_res, + { "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccdata_tsp, + { "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccdata_afi, + { "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC, + VALS(afn_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccdata_res2, + { "Reserved", "pgm.opts.ccdata.res2", FT_UINT16, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccdata_acker, + { "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccdata_acker6, + { "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccfeedbk_res, + { "Reserved", "pgm.opts.ccdata.res", FT_UINT8, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccfeedbk_tsp, + { "Time Stamp", "pgm.opts.ccdata.tstamp", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccfeedbk_afi, + { "Acker AFI", "pgm.opts.ccdata.afi", FT_UINT16, BASE_DEC, + VALS(afn_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccfeedbk_lossrate, + { "Loss Rate", "pgm.opts.ccdata.lossrate", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccfeedbk_acker, + { "Acker", "pgm.opts.ccdata.acker", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_ccfeedbk_acker6, + { "Acker", "pgm.opts.ccdata.acker", FT_IPv6, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_nak_bo_ivl_res, + { "Reserved", "pgm.opts.nak_bo_ivl.res", FT_UINT8, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_nak_bo_ivl_bo_ivl, + { "Back-off Interval", "pgm.opts.nak_bo_ivl.bo_ivl", FT_UINT32, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_nak_bo_ivl_bo_ivl_sqn, + { "Back-off Interval Sequence Number", "pgm.opts.nak_bo_ivl.bo_ivl_sqn", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_nak_bo_rng_res, + { "Reserved", "pgm.opts.nak_bo_rng.res", FT_UINT8, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_nak_bo_rng_min_bo_ivl, + { "Min Back-off Interval", "pgm.opts.nak_bo_rng.min_bo_ivl", FT_UINT32, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_nak_bo_rng_max_bo_ivl, + { "Max Back-off Interval", "pgm.opts.nak_bo_rng.max_bo_ivl", FT_UINT32, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_redirect_res, + { "Reserved", "pgm.opts.redirect.res", FT_UINT8, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_redirect_afi, + { "DLR AFI", "pgm.opts.redirect.afi", FT_UINT16, BASE_DEC, + VALS(afn_vals), 0x0, NULL, HFILL }}, + { &hf_pgm_opt_redirect_res2, + { "Reserved", "pgm.opts.redirect.res2", FT_UINT16, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_redirect_dlr, + { "DLR", "pgm.opts.redirect.dlr", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_redirect_dlr6, + { "DLR", "pgm.opts.redirect.dlr", FT_IPv6, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_fragment_res, + { "Reserved", "pgm.opts.fragment.res", FT_UINT8, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_fragment_first_sqn, + { "First Sequence Number", "pgm.opts.fragment.first_sqn", FT_UINT32, BASE_HEX, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_fragment_offset, + { "Fragment Offset", "pgm.opts.fragment.fragment_offset", FT_UINT32, BASE_DEC, + NULL, 0x0, NULL, HFILL }}, + { &hf_pgm_opt_fragment_total_length, + { "Total Length", "pgm.opts.fragment.total_length", FT_UINT32, BASE_DEC, + NULL, 0x0, NULL, HFILL }} + }; + static gint *ett[] = { + &ett_pgm, + &ett_pgm_optbits, + &ett_pgm_spm, + &ett_pgm_data, + &ett_pgm_nak, + &ett_pgm_poll, + &ett_pgm_polr, + &ett_pgm_ack, + &ett_pgm_opts, + &ett_pgm_opts_join, + &ett_pgm_opts_parityprm, + &ett_pgm_opts_paritygrp, + &ett_pgm_opts_naklist, + &ett_pgm_opts_ccdata, + &ett_pgm_opts_nak_bo_ivl, + &ett_pgm_opts_nak_bo_rng, + &ett_pgm_opts_redirect, + &ett_pgm_opts_fragment + }; + static ei_register_info ei[] = { + { &ei_pgm_opt_type, { "pgm.opts.type.invalid", PI_PROTOCOL, PI_WARN, "Invalid option", EXPFILL }}, + { &ei_pgm_opt_tlen, { "pgm.opts.tlen.invalid", PI_PROTOCOL, PI_WARN, "Total Length invalid", EXPFILL }}, + { &ei_pgm_genopt_len, { "pgm.genopts.len.invalid", PI_PROTOCOL, PI_WARN, "Option length invalid", EXPFILL }}, + { &ei_address_format_invalid, { "pgm.address_format_invalid", PI_PROTOCOL, PI_WARN, "Can't handle this address format", EXPFILL }}, + }; + + module_t *pgm_module; + expert_module_t* expert_pgm; + + proto_pgm = proto_register_protocol("Pragmatic General Multicast", + "PGM", "pgm"); + + proto_register_field_array(proto_pgm, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + expert_pgm = expert_register_protocol(proto_pgm); + expert_register_field_array(expert_pgm, ei, array_length(ei)); /* subdissector code */ - subdissector_table = register_dissector_table("pgm.port", - "PGM port", FT_UINT16, BASE_DEC); - register_heur_dissector_list("pgm", &heur_subdissector_list); - - /* - * Register configuration preferences for UDP encapsulation - * (Note: Initially the ports are set to zero and the ports - * are not registered so the dissecting of PGM - * encapsulated in UDP packets is off by default; - * dissector_add_for_decode_as is called so that pgm - * is available for 'decode-as' - */ - pgm_module = prefs_register_protocol(proto_pgm, proto_reg_handoff_pgm); - - prefs_register_bool_preference(pgm_module, "check_checksum", - "Check the validity of the PGM checksum when possible", - "Whether to check the validity of the PGM checksum", - &pgm_check_checksum); - - prefs_register_uint_preference(pgm_module, "udp.encap_ucast_port", - "PGM Encap Unicast Port (standard is 3055)", - "PGM Encap is PGM packets encapsulated in UDP packets" - " (Note: This option is off, i.e. port is 0, by default)", - 10, &udp_encap_ucast_port); - - prefs_register_uint_preference(pgm_module, "udp.encap_mcast_port", - "PGM Encap Multicast Port (standard is 3056)", - "PGM Encap is PGM packets encapsulated in UDP packets" - " (Note: This option is off, i.e. port is 0, by default)", - 10, &udp_encap_mcast_port); + subdissector_table = register_dissector_table("pgm.port", + "PGM port", FT_UINT16, BASE_DEC); + register_heur_dissector_list("pgm", &heur_subdissector_list); + + /* + * Register configuration preferences for UDP encapsulation + * (Note: Initially the ports are set to zero and the ports + * are not registered so the dissecting of PGM + * encapsulated in UDP packets is off by default; + * dissector_add_for_decode_as is called so that pgm + * is available for 'decode-as' + */ + pgm_module = prefs_register_protocol(proto_pgm, proto_reg_handoff_pgm); + + prefs_register_bool_preference(pgm_module, "check_checksum", + "Check the validity of the PGM checksum when possible", + "Whether to check the validity of the PGM checksum", + &pgm_check_checksum); + + prefs_register_uint_preference(pgm_module, "udp.encap_ucast_port", + "PGM Encap Unicast Port (standard is 3055)", + "PGM Encap is PGM packets encapsulated in UDP packets" + " (Note: This option is off, i.e. port is 0, by default)", + 10, &udp_encap_ucast_port); + + prefs_register_uint_preference(pgm_module, "udp.encap_mcast_port", + "PGM Encap Multicast Port (standard is 3056)", + "PGM Encap is PGM packets encapsulated in UDP packets" + " (Note: This option is off, i.e. port is 0, by default)", + 10, &udp_encap_mcast_port); } @@ -1447,32 +1447,45 @@ proto_register_pgm(void) void proto_reg_handoff_pgm(void) { - static gboolean initialized = FALSE; - static dissector_handle_t pgm_handle; - static guint old_udp_encap_ucast_port; - static guint old_udp_encap_mcast_port; - - if (! initialized) { - pgm_handle = create_dissector_handle(dissect_pgm, proto_pgm); - dissector_add_for_decode_as("udp.port", pgm_handle); - dissector_add_uint("ip.proto", IP_PROTO_PGM, pgm_handle); - data_handle = find_dissector("data"); - initialized = TRUE; - } else { - if (old_udp_encap_ucast_port != 0) { - dissector_delete_uint("udp.port", old_udp_encap_ucast_port, pgm_handle); - } - if (old_udp_encap_mcast_port != 0) { - dissector_delete_uint("udp.port", old_udp_encap_mcast_port, pgm_handle); - } - } - - if (udp_encap_ucast_port != 0) { - dissector_add_uint("udp.port", udp_encap_ucast_port, pgm_handle); - } - if (udp_encap_mcast_port != 0) { - dissector_add_uint("udp.port", udp_encap_mcast_port, pgm_handle); - } - old_udp_encap_ucast_port = udp_encap_ucast_port; - old_udp_encap_mcast_port = udp_encap_mcast_port; + static gboolean initialized = FALSE; + static dissector_handle_t pgm_handle; + static guint old_udp_encap_ucast_port; + static guint old_udp_encap_mcast_port; + + if (! initialized) { + pgm_handle = create_dissector_handle(dissect_pgm, proto_pgm); + dissector_add_for_decode_as("udp.port", pgm_handle); + dissector_add_uint("ip.proto", IP_PROTO_PGM, pgm_handle); + data_handle = find_dissector("data"); + initialized = TRUE; + } else { + if (old_udp_encap_ucast_port != 0) { + dissector_delete_uint("udp.port", old_udp_encap_ucast_port, pgm_handle); + } + if (old_udp_encap_mcast_port != 0) { + dissector_delete_uint("udp.port", old_udp_encap_mcast_port, pgm_handle); + } + } + + if (udp_encap_ucast_port != 0) { + dissector_add_uint("udp.port", udp_encap_ucast_port, pgm_handle); + } + if (udp_encap_mcast_port != 0) { + dissector_add_uint("udp.port", udp_encap_mcast_port, pgm_handle); + } + old_udp_encap_ucast_port = udp_encap_ucast_port; + old_udp_encap_mcast_port = udp_encap_mcast_port; } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-pppoe.c b/epan/dissectors/packet-pppoe.c index a1840d334a..cc3b80f860 100644 --- a/epan/dissectors/packet-pppoe.c +++ b/epan/dissectors/packet-pppoe.c @@ -218,96 +218,96 @@ static gboolean global_pppoe_show_tags_and_lengths = FALSE; static const value_string code_vals[] = { - {PPPOE_CODE_SESSION, "Session Data" }, - {PPPOE_CODE_PADO, "Active Discovery Offer (PADO)" }, - {PPPOE_CODE_PADI, "Active Discovery Initiation (PADI)" }, - {PPPOE_CODE_PADG, "Active Discovery Session-Grant (PADG)" }, - {PPPOE_CODE_PADC, "Active Discovery Session-Credit Resp.(PADC)" }, - {PPPOE_CODE_PADQ, "Active Discovery Quality (PADQ)" }, - {PPPOE_CODE_PADR, "Active Discovery Request (PADR)" }, - {PPPOE_CODE_PADS, "Active Discovery Session-confirmation (PADS)"}, - {PPPOE_CODE_PADT, "Active Discovery Terminate (PADT)" }, - {PPPOE_CODE_PADM, "Active Discovery Message (PADM)" }, - {PPPOE_CODE_PADN, "Active Discovery Network (PADN)" }, - {0, NULL } + {PPPOE_CODE_SESSION, "Session Data" }, + {PPPOE_CODE_PADO, "Active Discovery Offer (PADO)" }, + {PPPOE_CODE_PADI, "Active Discovery Initiation (PADI)" }, + {PPPOE_CODE_PADG, "Active Discovery Session-Grant (PADG)" }, + {PPPOE_CODE_PADC, "Active Discovery Session-Credit Resp.(PADC)" }, + {PPPOE_CODE_PADQ, "Active Discovery Quality (PADQ)" }, + {PPPOE_CODE_PADR, "Active Discovery Request (PADR)" }, + {PPPOE_CODE_PADS, "Active Discovery Session-confirmation (PADS)"}, + {PPPOE_CODE_PADT, "Active Discovery Terminate (PADT)" }, + {PPPOE_CODE_PADM, "Active Discovery Message (PADM)" }, + {PPPOE_CODE_PADN, "Active Discovery Network (PADN)" }, + {0, NULL } }; static const value_string tag_vals[] = { - {PPPOE_TAG_EOL, "End-Of-List" }, - {PPPOE_TAG_SVC_NAME, "Service-Name" }, - {PPPOE_TAG_AC_NAME, "AC-Name" }, - {PPPOE_TAG_HOST_UNIQ, "Host-Uniq" }, - {PPPOE_TAG_AC_COOKIE, "AC-Cookie" }, - {PPPOE_TAG_VENDOR, "Vendor-Specific" }, - {PPPOE_TAG_CREDITS, "Credits" }, - {PPPOE_TAG_METRICS, "Metrics" }, - {PPPOE_TAG_SEQ_NUM, "Sequence Number" }, - {PPPOE_TAG_CRED_SCALE, "Credit Scale Factor"}, - {PPPOE_TAG_RELAY_ID, "Relay-Session-Id" }, - {PPPOE_TAG_HURL, "HURL" }, - {PPPOE_TAG_MOTM, "MOTM" }, - {PPPOE_TAG_MAX_PAYLD, "PPP-Max-Payload" }, - {PPPOE_TAG_IP_RT_ADD, "IP Route Add" }, - {PPPOE_TAG_SVC_ERR, "Service-Name-Error"}, - {PPPOE_TAG_AC_ERR, "AC-System-Error" }, - {PPPOE_TAG_GENERIC_ERR,"Generic-Error" }, - {0, NULL } + {PPPOE_TAG_EOL, "End-Of-List" }, + {PPPOE_TAG_SVC_NAME, "Service-Name" }, + {PPPOE_TAG_AC_NAME, "AC-Name" }, + {PPPOE_TAG_HOST_UNIQ, "Host-Uniq" }, + {PPPOE_TAG_AC_COOKIE, "AC-Cookie" }, + {PPPOE_TAG_VENDOR, "Vendor-Specific" }, + {PPPOE_TAG_CREDITS, "Credits" }, + {PPPOE_TAG_METRICS, "Metrics" }, + {PPPOE_TAG_SEQ_NUM, "Sequence Number" }, + {PPPOE_TAG_CRED_SCALE, "Credit Scale Factor"}, + {PPPOE_TAG_RELAY_ID, "Relay-Session-Id" }, + {PPPOE_TAG_HURL, "HURL" }, + {PPPOE_TAG_MOTM, "MOTM" }, + {PPPOE_TAG_MAX_PAYLD, "PPP-Max-Payload" }, + {PPPOE_TAG_IP_RT_ADD, "IP Route Add" }, + {PPPOE_TAG_SVC_ERR, "Service-Name-Error"}, + {PPPOE_TAG_AC_ERR, "AC-System-Error" }, + {PPPOE_TAG_GENERIC_ERR,"Generic-Error" }, + {0, NULL } }; static const value_string vspec_tag_vals[] = { - {PPPOE_TAG_VSPEC_DSLF_CIRCUIT_ID, "Circuit-ID" }, - {PPPOE_TAG_VSPEC_DSLF_REMOTE_ID, "Remote-ID" }, - {PPPOE_TAG_VSPEC_DSLF_ACT_DATA_RATE_UP, "Actual-Data-Rate-Up" }, - {PPPOE_TAG_VSPEC_DSLF_ACT_DATA_RATE_DOWN, "Actual-Data-Rate-Down" }, - {PPPOE_TAG_VSPEC_DSLF_MIN_DATA_RATE_UP, "Min-Data-Rate-Up" }, - {PPPOE_TAG_VSPEC_DSLF_MIN_DATA_RATE_DOWN, "Min-Data-Rate-Down" }, - {PPPOE_TAG_VSPEC_DSLF_ATTAINABLE_DATA_RATE_UP, "Attainable-Data-Rate-Up" }, - {PPPOE_TAG_VSPEC_DSLF_ATTAINABLE_DATA_RATE_DOWN, "Attainable-Data-Rate-Down" }, - {PPPOE_TAG_VSPEC_DSLF_MAX_DATA_RATE_UP, "Max-Data-Rate-Up" }, - {PPPOE_TAG_VSPEC_DSLF_MAX_DATA_RATE_DOWN, "Max-Data-Rate-Down" }, - {PPPOE_TAG_VSPEC_DSLF_MIN_DATA_RATE_UP_LP, "Min-Data-Rate-Up-Low-Power" }, - {PPPOE_TAG_VSPEC_DSLF_MIN_DATA_RATE_DOWN_LP, "Min-Data-Rate-Down-Low-Power" }, - {PPPOE_TAG_VSPEC_DSLF_MAX_INT_DELAY_UP, "Max-Interleaving-Delay-Up" }, - {PPPOE_TAG_VSPEC_DSLF_ACT_INT_DELAY_UP, "Actual-Interleaving-Delay-Up" }, - {PPPOE_TAG_VSPEC_DSLF_MAX_INT_DELAY_DOWN, "Max-Interleaving-Delay-Down" }, - {PPPOE_TAG_VSPEC_DSLF_ACT_INT_DELAY_DOWN, "Actual-Interleaving-Delay-Down"}, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAPSULATION, "Access-Loop-Encapsulation" }, - {0, NULL } + {PPPOE_TAG_VSPEC_DSLF_CIRCUIT_ID, "Circuit-ID" }, + {PPPOE_TAG_VSPEC_DSLF_REMOTE_ID, "Remote-ID" }, + {PPPOE_TAG_VSPEC_DSLF_ACT_DATA_RATE_UP, "Actual-Data-Rate-Up" }, + {PPPOE_TAG_VSPEC_DSLF_ACT_DATA_RATE_DOWN, "Actual-Data-Rate-Down" }, + {PPPOE_TAG_VSPEC_DSLF_MIN_DATA_RATE_UP, "Min-Data-Rate-Up" }, + {PPPOE_TAG_VSPEC_DSLF_MIN_DATA_RATE_DOWN, "Min-Data-Rate-Down" }, + {PPPOE_TAG_VSPEC_DSLF_ATTAINABLE_DATA_RATE_UP, "Attainable-Data-Rate-Up" }, + {PPPOE_TAG_VSPEC_DSLF_ATTAINABLE_DATA_RATE_DOWN, "Attainable-Data-Rate-Down" }, + {PPPOE_TAG_VSPEC_DSLF_MAX_DATA_RATE_UP, "Max-Data-Rate-Up" }, + {PPPOE_TAG_VSPEC_DSLF_MAX_DATA_RATE_DOWN, "Max-Data-Rate-Down" }, + {PPPOE_TAG_VSPEC_DSLF_MIN_DATA_RATE_UP_LP, "Min-Data-Rate-Up-Low-Power" }, + {PPPOE_TAG_VSPEC_DSLF_MIN_DATA_RATE_DOWN_LP, "Min-Data-Rate-Down-Low-Power" }, + {PPPOE_TAG_VSPEC_DSLF_MAX_INT_DELAY_UP, "Max-Interleaving-Delay-Up" }, + {PPPOE_TAG_VSPEC_DSLF_ACT_INT_DELAY_UP, "Actual-Interleaving-Delay-Up" }, + {PPPOE_TAG_VSPEC_DSLF_MAX_INT_DELAY_DOWN, "Max-Interleaving-Delay-Down" }, + {PPPOE_TAG_VSPEC_DSLF_ACT_INT_DELAY_DOWN, "Actual-Interleaving-Delay-Down"}, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAPSULATION, "Access-Loop-Encapsulation" }, + {0, NULL } }; static const value_string vspec_tag_dslf_access_loop_encap_data_link_vals[] = { - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_DATA_LINK_ATM, "ATM AAL5"}, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_DATA_LINK_ETH, "Ethernet"}, - {0, NULL } + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_DATA_LINK_ATM, "ATM AAL5"}, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_DATA_LINK_ETH, "Ethernet"}, + {0, NULL } }; static const value_string vspec_tag_dslf_access_loop_encap_encap_1_vals[] = { - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_1_NA, "NA" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_1_UNTAGGED_ETH, "Untagged Ethernet" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_1_SINLE_TAGGED_ETH, "Single-tagged Ethernet"}, - {0, NULL } + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_1_NA, "NA" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_1_UNTAGGED_ETH, "Untagged Ethernet" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_1_SINLE_TAGGED_ETH, "Single-tagged Ethernet"}, + {0, NULL } }; static const value_string vspec_tag_dslf_access_loop_encap_encap_2_vals[] = { - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_NA, "NA" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_PPPOA_LLC, "PPPoA LLC" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_PPPOA_NULL, "PPPoA Null" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_IPOA_LLC, "IPoA LLC" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_IPOA_NULL, "IPoA Null" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_ETH_OVER_AAL5_LLC_WITH_FCS, "Ethernet over AAL5 LLC w FCS" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_ETH_OVER_AAL5_LLC_WITHOUT_FCS, "Ethernet over AAL5 LLC w/o FCS" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_ETH_OVER_AAL5_NULL_WITH_FCS, "Ethernet over AAL5 Null w FCS" }, - {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_ETH_OVER_AAL5_NULL_WITHOUT_FCS,"Ethernet over AAL5 Null w/o FCS"}, - {0, NULL } + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_NA, "NA" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_PPPOA_LLC, "PPPoA LLC" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_PPPOA_NULL, "PPPoA Null" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_IPOA_LLC, "IPoA LLC" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_IPOA_NULL, "IPoA Null" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_ETH_OVER_AAL5_LLC_WITH_FCS, "Ethernet over AAL5 LLC w FCS" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_ETH_OVER_AAL5_LLC_WITHOUT_FCS, "Ethernet over AAL5 LLC w/o FCS" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_ETH_OVER_AAL5_NULL_WITH_FCS, "Ethernet over AAL5 Null w FCS" }, + {PPPOE_TAG_VSPEC_DSLF_ACCESS_LOOP_ENCAP_ENCAPS_2_ETH_OVER_AAL5_NULL_WITHOUT_FCS,"Ethernet over AAL5 Null w/o FCS"}, + {0, NULL } }; static const value_string datarate_scale_vals[] = { - {PPPOE_SCALE_KBPS, "kilobits per second"}, - {PPPOE_SCALE_MBPS, "megabits per second"}, - {PPPOE_SCALE_GBPS, "gigabits per second"}, - {PPPOE_SCALE_TBPS, "terabits per second"}, - {0, NULL } + {PPPOE_SCALE_KBPS, "kilobits per second"}, + {PPPOE_SCALE_MBPS, "megabits per second"}, + {PPPOE_SCALE_GBPS, "gigabits per second"}, + {PPPOE_SCALE_TBPS, "terabits per second"}, + {0, NULL } }; @@ -336,7 +336,7 @@ static const value_string datarate_scale_vals[] = { /* Dissect Vendor-Specific Tags introduced by the DSLF */ static void dissect_pppoe_subtags_dslf(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *tree, - int payload_length) + int payload_length) { guint8 poe_tag; guint8 poe_tag_length; @@ -440,12 +440,12 @@ dissect_pppoe_subtags_dslf(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, pr /* Dissect discovery protocol tags */ static void dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, - int payload_length) + int payload_length) { guint16 poe_tag; guint16 poe_tag_length; int tagstart; - guint16 poe_rsv = 0; + guint16 poe_rsv = 0; proto_tree *pppoe_tree; proto_item *ti; @@ -535,13 +535,13 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr case PPPOE_TAG_METRICS: if (poe_tag_length == 10) { - poe_rsv = tvb_get_ntohs(tvb, tagstart+4); + poe_rsv = tvb_get_ntohs(tvb, tagstart+4); - proto_tree_add_item(pppoe_tree, hf_pppoed_tag_mdr_units, tvb, - tagstart+4, 2, ENC_BIG_ENDIAN); - proto_tree_add_item(pppoe_tree, hf_pppoed_tag_cdr_units, tvb, - tagstart+4, 2, ENC_BIG_ENDIAN); - proto_tree_add_item(pppoe_tree, hf_pppoed_tag_metrics_r, tvb, + proto_tree_add_item(pppoe_tree, hf_pppoed_tag_mdr_units, tvb, + tagstart+4, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(pppoe_tree, hf_pppoed_tag_cdr_units, tvb, + tagstart+4, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(pppoe_tree, hf_pppoed_tag_metrics_r, tvb, tagstart+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(pppoe_tree, hf_pppoed_tag_metrics_rlq, tvb, tagstart+6, 1, ENC_BIG_ENDIAN); @@ -550,45 +550,45 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr proto_tree_add_item(pppoe_tree, hf_pppoed_tag_metrics_latency, tvb, tagstart+8, 2, ENC_BIG_ENDIAN); - /* CDR */ + /* CDR */ ti = proto_tree_add_item(pppoe_tree, hf_pppoed_tag_metrics_curr_drate, tvb, - tagstart+10, 2, ENC_BIG_ENDIAN); - - switch ((poe_rsv & PPPOE_CDR_MASK) >> 1) - { - case (PPPOE_SCALE_KBPS): - proto_item_append_text(ti, " kbps"); - break; - case (PPPOE_SCALE_MBPS): - proto_item_append_text(ti, " mbps"); - break; - case (PPPOE_SCALE_GBPS): - proto_item_append_text(ti, " gbps"); - break; - case (PPPOE_SCALE_TBPS): - proto_item_append_text(ti, " tbps"); - break; - } - - /* MDR */ + tagstart+10, 2, ENC_BIG_ENDIAN); + + switch ((poe_rsv & PPPOE_CDR_MASK) >> 1) + { + case (PPPOE_SCALE_KBPS): + proto_item_append_text(ti, " kbps"); + break; + case (PPPOE_SCALE_MBPS): + proto_item_append_text(ti, " mbps"); + break; + case (PPPOE_SCALE_GBPS): + proto_item_append_text(ti, " gbps"); + break; + case (PPPOE_SCALE_TBPS): + proto_item_append_text(ti, " tbps"); + break; + } + + /* MDR */ ti = proto_tree_add_item(pppoe_tree, hf_pppoed_tag_metrics_max_drate, tvb, tagstart+12, 2, ENC_BIG_ENDIAN); - switch ((poe_rsv & PPPOE_MDR_MASK) >> 3) - { - case (PPPOE_SCALE_KBPS): - proto_item_append_text(ti, " kbps"); - break; - case (PPPOE_SCALE_MBPS): - proto_item_append_text(ti, " mbps"); - break; - case (PPPOE_SCALE_GBPS): - proto_item_append_text(ti, " gbps"); - break; - case (PPPOE_SCALE_TBPS): - proto_item_append_text(ti, " tbps"); - break; - } + switch ((poe_rsv & PPPOE_MDR_MASK) >> 3) + { + case (PPPOE_SCALE_KBPS): + proto_item_append_text(ti, " kbps"); + break; + case (PPPOE_SCALE_MBPS): + proto_item_append_text(ti, " mbps"); + break; + case (PPPOE_SCALE_GBPS): + proto_item_append_text(ti, " gbps"); + break; + case (PPPOE_SCALE_TBPS): + proto_item_append_text(ti, " tbps"); + break; + } } else { proto_tree_add_item(pppoe_tree, hf_pppoed_tag_metrics, tvb, @@ -604,11 +604,11 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr proto_item_append_text(pppoe_tree_tag_length_item, " [Wrong: should be 2]"); } - proto_tree_add_expert_format(pppoe_tree, pinfo, &ei_pppoe_tag_length, tvb, tagstart+4, poe_tag_length, + proto_tree_add_expert_format(pppoe_tree, pinfo, &ei_pppoe_tag_length, tvb, tagstart+4, poe_tag_length, "Sequence Number tag: Wrong length: %u (expected 2)", poe_tag_length); } break; - case PPPOE_TAG_CRED_SCALE: + case PPPOE_TAG_CRED_SCALE: if (poe_tag_length == 2) { proto_tree_add_item(pppoe_tree, hf_pppoed_tag_cred_scale, tvb, tagstart+4, poe_tag_length, ENC_BIG_ENDIAN); @@ -619,7 +619,7 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr proto_tree_add_expert_format(pppoe_tree, pinfo, &ei_pppoe_tag_length, tvb, tagstart+4, poe_tag_length, "Credit Scale Factor tag: Wrong length: %u (expected 2)", poe_tag_length); } - break; + break; case PPPOE_TAG_RELAY_ID: proto_tree_add_item(pppoe_tree, hf_pppoed_tag_relay_session_id, tvb, tagstart+4, poe_tag_length, ENC_NA); @@ -1298,3 +1298,16 @@ void proto_reg_handoff_pppoes(void) /* Get a handle for the PPP dissector */ ppp_handle = find_dissector("ppp"); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-pw-atm.c b/epan/dissectors/packet-pw-atm.c index 0046e6b90c..d0cd7660ee 100644 --- a/epan/dissectors/packet-pw-atm.c +++ b/epan/dissectors/packet-pw-atm.c @@ -26,7 +26,7 @@ */ /* - DONE: + DONE: - ATM N-to-One Cell Mode (with CW) - ATM N-to-One Cell Mode (no CW) - ATM One-to-One Cell Mode @@ -1982,3 +1982,16 @@ proto_reg_handoff_pw_atm_ata(void) dh_padding = find_dissector("pw_padding"); dh_data = find_dissector("data"); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-q708.c b/epan/dissectors/packet-q708.c index 69f13ca8cb..5cdf29ee4f 100644 --- a/epan/dissectors/packet-q708.c +++ b/epan/dissectors/packet-q708.c @@ -12626,3 +12626,16 @@ proto_register_q708(void) proto_register_field_array(proto_q708, hf, array_length(hf)); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-q933.c b/epan/dissectors/packet-q933.c index 5c06aa8cea..7fd00a81a8 100644 --- a/epan/dissectors/packet-q933.c +++ b/epan/dissectors/packet-q933.c @@ -134,8 +134,8 @@ static const true_false_string tfs_call_ref_flag = { /* next octet. The bit value "1" indicates that this octet is the last octet */ static const true_false_string q933_extension_ind_value = { - "last octet", - "information continues through the next octet", + "last octet", + "information continues through the next octet", }; @@ -231,12 +231,12 @@ static const value_string q933_info_element_vals4[] = { /* Codeset 5 */ static const value_string q933_info_element_vals5[] = { - { Q933_IE_ANSI_REPORT_TYPE, "Report type (ANSI)" }, - { Q933_IE_REPORT_TYPE, "Report type (CCITT)" }, - { Q933_IE_ANSI_LINK_INTEGRITY_VERF, "Keep Alive (ANSI)" }, - { Q933_IE_LINK_INTEGRITY_VERF, "Keep Alive (CCITT)" }, - { Q933_IE_ANSI_PVC_STATUS, "PVC Status (ANSI)" }, - { Q933_IE_PVC_STATUS, "PVC Status (CCITT)" }, + { Q933_IE_ANSI_REPORT_TYPE, "Report type (ANSI)" }, + { Q933_IE_REPORT_TYPE, "Report type (CCITT)" }, + { Q933_IE_ANSI_LINK_INTEGRITY_VERF, "Keep Alive (ANSI)" }, + { Q933_IE_LINK_INTEGRITY_VERF, "Keep Alive (CCITT)" }, + { Q933_IE_ANSI_PVC_STATUS, "PVC Status (ANSI)" }, + { Q933_IE_PVC_STATUS, "PVC Status (CCITT)" }, { 0, NULL } }; /* Codeset 6 */ @@ -251,14 +251,14 @@ static const value_string q933_info_element_vals7[] = { /* Codeset array */ #define NUM_INFO_ELEMENT_VALS (Q933_IE_SHIFT_CODESET+1) static const value_string *q933_info_element_vals[NUM_INFO_ELEMENT_VALS] = { - q933_info_element_vals0, - q933_info_element_vals1, - q933_info_element_vals2, - q933_info_element_vals3, - q933_info_element_vals4, - q933_info_element_vals5, - q933_info_element_vals6, - q933_info_element_vals7, + q933_info_element_vals0, + q933_info_element_vals1, + q933_info_element_vals2, + q933_info_element_vals3, + q933_info_element_vals4, + q933_info_element_vals5, + q933_info_element_vals6, + q933_info_element_vals7, }; static const value_string q933_repeat_indication_vals[] = { @@ -276,7 +276,7 @@ static const value_string q933_repeat_indication_vals[] = { */ static void dissect_q933_segmented_message_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { if (len != 2) { proto_tree_add_text(tree, tvb, offset, len, @@ -466,7 +466,7 @@ dissect_q933_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree) static void dissect_q933_bearer_capability_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 octet; guint8 coding_standard; @@ -889,7 +889,7 @@ static const value_string q933_rejection_reason_vals[] = { static void dissect_q933_cause_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree, int hf_cause_value) + proto_tree *tree, int hf_cause_value) { guint8 octet; guint8 cause_value; @@ -1069,7 +1069,7 @@ static const value_string q933_call_state_vals[] = { static void dissect_q933_call_state_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 octet; guint8 coding_standard; @@ -1103,15 +1103,15 @@ dissect_q933_call_state_ie(tvbuff_t *tvb, int offset, int len, #define Q933_IE_REPORT_TYPE_ASYNC_PVC_STATUS 0x02 static const value_string q933_report_type_vals[] = { - { Q933_IE_REPORT_TYPE_FULL_STATUS, "Full Status" }, - { Q933_IE_REPORT_TYPE_LINK_VERIFY, "Link verify" }, - { Q933_IE_REPORT_TYPE_ASYNC_PVC_STATUS, "Async PVC Status" }, + { Q933_IE_REPORT_TYPE_FULL_STATUS, "Full Status" }, + { Q933_IE_REPORT_TYPE_LINK_VERIFY, "Link verify" }, + { Q933_IE_REPORT_TYPE_ASYNC_PVC_STATUS, "Async PVC Status" }, { 0, NULL } }; static void dissect_q933_report_type_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 report_type; @@ -1127,7 +1127,7 @@ dissect_q933_report_type_ie(tvbuff_t *tvb, int offset, int len, */ static void dissect_q933_link_integrity_verf_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 txseq,rxseq; @@ -1146,40 +1146,40 @@ dissect_q933_link_integrity_verf_ie(tvbuff_t *tvb, int offset, int len, * Dissect a PVC status information element. */ static const value_string q933_pvc_status_vals[] = { - {0x00, "Inactive"}, - {0x02, "Active"}, - {0x08, "New"}, - {0x0a, "New, Active"}, - {0, NULL} + {0x00, "Inactive"}, + {0x02, "Active"}, + {0x08, "New"}, + {0x0a, "New, Active"}, + {0, NULL} }; static void dissect_q933_pvc_status_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint32 dlci; - guint8 dlci_status,dlci_len=2; + guint8 dlci_status,dlci_len=2; if (len < 3) return; - dlci = ((tvb_get_guint8(tvb, offset) & 0x3F) << 4) | - ((tvb_get_guint8(tvb, offset+1) & 0x78) >> 3); - - /* first determine the DLCI field length */ - if (len == 4) { - dlci = (dlci << 6) | ((tvb_get_guint8(tvb, offset+2) & 0x7E) >> 1); - dlci_len++; - } else if (len == 5) { - dlci = (dlci << 13) | (tvb_get_guint8(tvb, offset+3) & 0x7F) | - ((tvb_get_guint8(tvb, offset+4) & 0x7E) >> 1); - dlci_len+=2; - } - dlci_status=tvb_get_guint8(tvb, offset+dlci_len)&0x0a; + dlci = ((tvb_get_guint8(tvb, offset) & 0x3F) << 4) | + ((tvb_get_guint8(tvb, offset+1) & 0x78) >> 3); + + /* first determine the DLCI field length */ + if (len == 4) { + dlci = (dlci << 6) | ((tvb_get_guint8(tvb, offset+2) & 0x7E) >> 1); + dlci_len++; + } else if (len == 5) { + dlci = (dlci << 13) | (tvb_get_guint8(tvb, offset+3) & 0x7F) | + ((tvb_get_guint8(tvb, offset+4) & 0x7E) >> 1); + dlci_len+=2; + } + dlci_status=tvb_get_guint8(tvb, offset+dlci_len)&0x0a; proto_tree_add_text(tree, tvb, offset, dlci_len, "DLCI: %u", dlci); proto_tree_add_text(tree, tvb, offset+dlci_len, 1, "Status: %s", - val_to_str_const(dlci_status, q933_pvc_status_vals, "Unknown")); + val_to_str_const(dlci_status, q933_pvc_status_vals, "Unknown")); } /* @@ -1215,7 +1215,7 @@ static const value_string q933_element_type_vals[] = { static void dissect_q933_channel_identification_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 octet; int identifier_offset; @@ -1321,7 +1321,7 @@ static const value_string q933_progress_description_vals[] = { static void dissect_q933_progress_indicator_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 octet; guint8 coding_standard; @@ -1377,7 +1377,7 @@ static const value_string q933_netid_plan_vals[] = { static void dissect_q933_ns_facilities_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 octet; int netid_len; @@ -1433,7 +1433,7 @@ dissect_q933_ns_facilities_ie(tvbuff_t *tvb, int offset, int len, static int dissect_q933_guint16_value(tvbuff_t *tvb, int offset, int len, - proto_tree *tree, const char *label) + proto_tree *tree, const char *label) { guint8 octet; guint16 value; @@ -1509,7 +1509,7 @@ bad_length: */ static void dissect_q933_e2e_transit_delay_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { int value_len; @@ -1542,7 +1542,7 @@ dissect_q933_e2e_transit_delay_ie(tvbuff_t *tvb, int offset, int len, */ static void dissect_q933_td_selection_and_int_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { if (len == 0) return; @@ -1552,7 +1552,7 @@ dissect_q933_td_selection_and_int_ie(tvbuff_t *tvb, int offset, int len, static void dissect_q933_pl_binary_parameters_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 octet; @@ -1578,7 +1578,7 @@ static const value_string q933_reverse_charging_indication_vals[] = { static void dissect_q933_reverse_charge_ind_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { if (len == 0) return; @@ -1639,7 +1639,7 @@ static const value_string q933_redirection_reason_vals[] = { static void dissect_q933_number_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree, int hfindex) + proto_tree *tree, int hfindex) { guint8 octet; @@ -1701,7 +1701,7 @@ static const value_string q933_odd_even_indicator_vals[] = { static void dissect_q933_party_subaddr_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 octet; @@ -1759,7 +1759,7 @@ static const value_string q933_audiovisual_characteristics_vals[] = { static void dissect_q933_high_layer_compat_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 octet; guint8 coding_standard; @@ -1834,7 +1834,7 @@ static const value_string q933_protocol_discriminator_vals[] = { static void dissect_q933_user_user_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree) + proto_tree *tree) { guint8 octet; @@ -1869,7 +1869,7 @@ dissect_q933_user_user_ie(tvbuff_t *tvb, int offset, int len, */ static void dissect_q933_ia5_ie(tvbuff_t *tvb, int offset, int len, proto_tree *tree, - const char *label) + const char *label) { if (len != 0) { proto_tree_add_text(tree, tvb, offset, len, "%s: %s", label, @@ -2133,7 +2133,7 @@ dissect_q933(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case CS5 | Q933_IE_LINK_INTEGRITY_VERF: case CS5 | Q933_IE_ANSI_LINK_INTEGRITY_VERF: - dissect_q933_link_integrity_verf_ie(tvb, + dissect_q933_link_integrity_verf_ie(tvb, offset + 2, info_element_len, ie_tree); break; @@ -2277,3 +2277,16 @@ proto_reg_handoff_q933(void) q933_handle = find_dissector("q933"); dissector_add_uint("fr.osinl", NLPID_Q_933, q933_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-rsip.c b/epan/dissectors/packet-rsip.c index c5557dd7f8..6bc7b8b572 100644 --- a/epan/dissectors/packet-rsip.c +++ b/epan/dissectors/packet-rsip.c @@ -77,15 +77,15 @@ static gint ett_rsip_param_val = -1; /* Message Types in RFC 3103 Appendix B / RFC 3104 Appendix C style */ static const value_string msg_type_appendix_vals[] = { - { 1, "ERROR_RESPONSE" }, - { 2, "REGISTER_REQUEST" }, - { 3, "REGISTER_RESPONSE" }, - { 4, "DE-REGISTER_REQUEST" }, - { 5, "DE-REGISTER_RESPONSE" }, - { 6, "ASSIGN_REQUEST_RSA-IP" }, - { 7, "ASSIGN_RESPONSE_RSA-IP" }, - { 8, "ASSIGN_REQUEST_RSAP-IP" }, - { 9, "ASSIGN_RESPONSE_RSAP-IP" }, + { 1, "ERROR_RESPONSE" }, + { 2, "REGISTER_REQUEST" }, + { 3, "REGISTER_RESPONSE" }, + { 4, "DE-REGISTER_REQUEST" }, + { 5, "DE-REGISTER_RESPONSE" }, + { 6, "ASSIGN_REQUEST_RSA-IP" }, + { 7, "ASSIGN_RESPONSE_RSA-IP" }, + { 8, "ASSIGN_REQUEST_RSAP-IP" }, + { 9, "ASSIGN_RESPONSE_RSAP-IP" }, { 10, "EXTEND_REQUEST" }, { 11, "EXTEND_RESPONSE" }, { 12, "FREE_REQUEST" }, @@ -100,15 +100,15 @@ static const value_string msg_type_appendix_vals[] = { }; static const value_string msg_type_vals[] = { - { 1, "Error Response" }, - { 2, "Register Request" }, - { 3, "Register Response" }, - { 4, "Deregister Request" }, - { 5, "Deregister Response" }, - { 6, "Assign Request RSA-IP" }, - { 7, "Assign Response RSA-IP" }, - { 8, "Assign Request RSAP-IP" }, - { 9, "Assign Response RSAP-IP" }, + { 1, "Error Response" }, + { 2, "Register Request" }, + { 3, "Register Response" }, + { 4, "Deregister Request" }, + { 5, "Deregister Response" }, + { 6, "Assign Request RSA-IP" }, + { 7, "Assign Response RSA-IP" }, + { 8, "Assign Request RSAP-IP" }, + { 9, "Assign Response RSAP-IP" }, { 10, "Extend Request" }, { 11, "Extend Response" }, { 12, "Free Request" }, @@ -123,15 +123,15 @@ static const value_string msg_type_vals[] = { }; static const value_string param_type_vals[] = { - { 1, "Address" }, - { 2, "Port" }, - { 3, "Lease Time" }, - { 4, "Client ID" }, - { 5, "Bind ID" }, - { 6, "Tunnel Type" }, - { 7, "RSIP Method" }, - { 8, "Error" }, - { 9, "Flow Policy" }, + { 1, "Address" }, + { 2, "Port" }, + { 3, "Lease Time" }, + { 4, "Client ID" }, + { 5, "Bind ID" }, + { 6, "Tunnel Type" }, + { 7, "RSIP Method" }, + { 8, "Error" }, + { 9, "Flow Policy" }, { 10, "Indicator" }, { 11, "Message Counter" }, { 12, "Vendor Specific" }, @@ -497,7 +497,7 @@ rsip_parameter(tvbuff_t *tvb, proto_tree *rsip_tree, int off, int eoff) static int rsip_message_error_response(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -520,7 +520,7 @@ rsip_message_error_response(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_register_request(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -540,7 +540,7 @@ rsip_message_register_request(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_register_response(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -565,7 +565,7 @@ rsip_message_register_response(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_deregister_request(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -586,14 +586,14 @@ rsip_message_deregister_request(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_deregister_response(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { return rsip_message_deregister_request(tvb, rsip_tree, offset, eoffset); } static int rsip_message_assign_request_rsaip(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -619,7 +619,7 @@ rsip_message_assign_request_rsaip(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_assign_response_rsaip(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -647,7 +647,7 @@ rsip_message_assign_response_rsaip(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_assign_request_rsapip(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -674,7 +674,7 @@ rsip_message_assign_request_rsapip(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_assign_response_rsapip(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -703,7 +703,7 @@ rsip_message_assign_response_rsapip(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_extend_request(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -726,7 +726,7 @@ rsip_message_extend_request(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_extend_response(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -749,7 +749,7 @@ rsip_message_extend_response(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_free_request(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -771,7 +771,7 @@ rsip_message_free_request(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_free_response(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -793,7 +793,7 @@ rsip_message_free_response(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_query_request(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -823,7 +823,7 @@ rsip_message_query_request(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_query_response(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -862,7 +862,7 @@ rsip_message_query_response(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_listen_request(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -889,7 +889,7 @@ rsip_message_listen_request(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_listen_response(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -918,7 +918,7 @@ rsip_message_listen_response(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_assign_request_rsipsec(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -945,7 +945,7 @@ rsip_message_assign_request_rsipsec(tvbuff_t *tvb, proto_tree *rsip_tree, static int rsip_message_assign_response_rsipsec(tvbuff_t *tvb, proto_tree *rsip_tree, - int offset, int eoffset) + int offset, int eoffset) { int consumed, offset_delta; /* @@ -1259,3 +1259,16 @@ proto_reg_handoff_rsip(void) initialized = TRUE; } } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-s5066sis.c b/epan/dissectors/packet-s5066sis.c index 6b95708b30..241f619fc1 100644 --- a/epan/dissectors/packet-s5066sis.c +++ b/epan/dissectors/packet-s5066sis.c @@ -823,17 +823,17 @@ proto_reg_handoff_s5066(void) static guint dissect_s5066_address(tvbuff_t *tvb, guint offset, proto_tree *tree, gint source) { - proto_tree *s5066_tree_address; + proto_tree *s5066_tree_address; guint32 addr; - if (source) { + if (source) { s5066_tree_address = proto_tree_add_subtree(tree, tvb, offset, 4, ett_s5066_address, NULL, "Source Address"); } else { s5066_tree_address = proto_tree_add_subtree(tree, tvb, offset, 4, ett_s5066_address, NULL, "Destination Address"); } - proto_tree_add_item(s5066_tree_address, hf_s5066_ad_size, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(s5066_tree_address, hf_s5066_ad_size, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(s5066_tree_address, hf_s5066_ad_group, tvb, offset, 1, ENC_BIG_ENDIAN); addr = tvb_get_ntohl(tvb, offset); addr = addr & 0x1FFFFFFF; @@ -1254,13 +1254,13 @@ dissect_s5066_27(tvbuff_t *tvb, guint offset, proto_tree *tree) static guint get_s5066_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { - guint16 plen; + guint16 plen; - /* Get the length of the S5066 PDU. */ - plen = tvb_get_ntohs(tvb, offset + s5066_size_offset); + /* Get the length of the S5066 PDU. */ + plen = tvb_get_ntohs(tvb, offset + s5066_size_offset); - /* That length doesn't include the sync, version and length fields; add that in. */ - return plen + s5066_header_size; + /* That length doesn't include the sync, version and length fields; add that in. */ + return plen + s5066_header_size; } static int @@ -1356,3 +1356,16 @@ dissect_s5066_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* return tvb_length(tvb); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-smb-browse.c b/epan/dissectors/packet-smb-browse.c index 5b7f910092..141f29ac5d 100644 --- a/epan/dissectors/packet-smb-browse.c +++ b/epan/dissectors/packet-smb-browse.c @@ -112,16 +112,16 @@ static gint ett_browse_election_os = -1; static gint ett_browse_election_desire = -1; static gint ett_browse_reset_cmd_flags = -1; -#define SERVER_WORKSTATION 0 -#define SERVER_SERVER 1 -#define SERVER_SQL_SERVER 2 -#define SERVER_DOMAIN_CONTROLLER 3 -#define SERVER_BACKUP_CONTROLLER 4 -#define SERVER_TIME_SOURCE 5 -#define SERVER_APPLE_SERVER 6 -#define SERVER_NOVELL_SERVER 7 -#define SERVER_DOMAIN_MEMBER_SERVER 8 -#define SERVER_PRINT_QUEUE_SERVER 9 +#define SERVER_WORKSTATION 0 +#define SERVER_SERVER 1 +#define SERVER_SQL_SERVER 2 +#define SERVER_DOMAIN_CONTROLLER 3 +#define SERVER_BACKUP_CONTROLLER 4 +#define SERVER_TIME_SOURCE 5 +#define SERVER_APPLE_SERVER 6 +#define SERVER_NOVELL_SERVER 7 +#define SERVER_DOMAIN_MEMBER_SERVER 8 +#define SERVER_PRINT_QUEUE_SERVER 9 #define SERVER_DIALIN_SERVER 10 #define SERVER_XENIX_SERVER 11 #define SERVER_NT_WORKSTATION 12 @@ -187,10 +187,10 @@ static const value_string server_types[] = { windows_version = ""; static const value_string resetbrowserstate_command_names[] = { - { 0x01, "Stop being a master browser and become a backup browser"}, - { 0x02, "Discard browse lists, stop being a master browser, and try again"}, - { 0x04, "Stop being a master browser for ever"}, - { 0, NULL} + { 0x01, "Stop being a master browser and become a backup browser"}, + { 0x02, "Discard browse lists, stop being a master browser, and try again"}, + { 0x04, "Stop being a master browser for ever"}, + { 0, NULL} }; static true_false_string tfs_demote_to_backup = { @@ -341,10 +341,10 @@ static const true_false_string tfs_desire_nt = { "NOT Windows NT Advanced Server" }; -#define BROWSE_HOST_ANNOUNCE 1 -#define BROWSE_REQUEST_ANNOUNCE 2 -#define BROWSE_ELECTION_REQUEST 8 -#define BROWSE_BACKUP_LIST_REQUEST 9 +#define BROWSE_HOST_ANNOUNCE 1 +#define BROWSE_REQUEST_ANNOUNCE 2 +#define BROWSE_ELECTION_REQUEST 8 +#define BROWSE_BACKUP_LIST_REQUEST 9 #define BROWSE_BACKUP_LIST_RESPONSE 10 #define BROWSE_BECOME_BACKUP 11 #define BROWSE_DOMAIN_ANNOUNCEMENT 12 @@ -353,16 +353,16 @@ static const true_false_string tfs_desire_nt = { #define BROWSE_LOCAL_MASTER_ANNOUNCEMENT 15 static const value_string commands[] = { - {BROWSE_HOST_ANNOUNCE, "Host Announcement"}, - {BROWSE_REQUEST_ANNOUNCE, "Request Announcement"}, - {BROWSE_ELECTION_REQUEST, "Browser Election Request"}, - {BROWSE_BACKUP_LIST_REQUEST, "Get Backup List Request"}, - {BROWSE_BACKUP_LIST_RESPONSE, "Get Backup List Response"}, - {BROWSE_BECOME_BACKUP, "Become Backup Browser"}, - {BROWSE_DOMAIN_ANNOUNCEMENT, "Domain/Workgroup Announcement"}, - {BROWSE_MASTER_ANNOUNCEMENT, "Master Announcement"}, + {BROWSE_HOST_ANNOUNCE, "Host Announcement"}, + {BROWSE_REQUEST_ANNOUNCE, "Request Announcement"}, + {BROWSE_ELECTION_REQUEST, "Browser Election Request"}, + {BROWSE_BACKUP_LIST_REQUEST, "Get Backup List Request"}, + {BROWSE_BACKUP_LIST_RESPONSE, "Get Backup List Response"}, + {BROWSE_BECOME_BACKUP, "Become Backup Browser"}, + {BROWSE_DOMAIN_ANNOUNCEMENT, "Domain/Workgroup Announcement"}, + {BROWSE_MASTER_ANNOUNCEMENT, "Master Announcement"}, {BROWSE_RESETBROWSERSTATE_ANNOUNCEMENT, "Reset Browser State Announcement"}, - {BROWSE_LOCAL_MASTER_ANNOUNCEMENT,"Local Master Announcement"}, + {BROWSE_LOCAL_MASTER_ANNOUNCEMENT, "Local Master Announcement"}, {0, NULL} }; @@ -1173,3 +1173,16 @@ proto_register_smb_browse(void) register_dissector("mailslot_lanman", dissect_mailslot_lanman, proto_smb_browse); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-smb-logon.c b/epan/dissectors/packet-smb-logon.c index f3cd09f9dd..6e7db17af4 100644 --- a/epan/dissectors/packet-smb-logon.c +++ b/epan/dissectors/packet-smb-logon.c @@ -249,7 +249,7 @@ dissect_smb_logon_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre offset += 1; /* NT version */ - proto_tree_add_item(tree, hf_nt_version, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tree, hf_nt_version, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* LM token */ @@ -290,7 +290,7 @@ dissect_smb_logon_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset = display_ms_string(tvb, tree, offset, hf_mailslot_name, NULL); /* NT version */ - proto_tree_add_item(tree, hf_nt_version, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tree, hf_nt_version, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* LM token */ @@ -397,7 +397,7 @@ dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, } /* NT version */ - proto_tree_add_item(tree, hf_nt_version, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tree, hf_nt_version, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; /* LMNT token */ @@ -834,62 +834,62 @@ dissect_smb_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int #define LOGON_LAST_CMD 0x19 static const value_string commands[] = { - {LOGON_LM10_LOGON_REQUEST, "LM1.0/LM2.0 LOGON Request"}, - {LOGON_LM10_LOGON_RESPONSE, "LM1.0 LOGON Response"}, - {LOGON_LM10_QUERY_CI, "LM1.0 Query - Centralized Initialization"}, - {LOGON_LM10_QUERY_DI, "LM1.0 Query - Distributed Initialization"}, - {LOGON_LM10_RESPONSE_CI, "LM1.0 Response - Centralized Query"}, - {LOGON_LM10_RESPONSE_DI, "LM1.0 Response - Distributed Initialization"}, - {LOGON_LM20_LOGON_RESPONSE, "LM2.0 Response to LOGON Request"}, - {LOGON_PDC_QUERY, "Query for PDC"}, - {LOGON_PDC_STARTUP, "Announce Startup of PDC"}, - {LOGON_PDC_FAILED, "Announce Failed PDC"}, - {LOGON_UAS_SAM, "Announce Change to UAS or SAM"}, - {LOGON_NO_USER, "Announce no user on machine"}, - {LOGON_PDC_RESPONSE, "Response from PDC"}, - {LOGON_RELOGON_RESPONSE, "LM1.0/LM2.0 Response to re-LOGON Request"}, - {LOGON_INTERROGATE_RESPONSE, "LM1.0/LM2.0 Response to Interrogate Request"}, - {LOGON_LM20_RESPONSE_DURING_LOGON,"LM2.0 Response during LOGON pause"}, - {LOGON_LM20_USER_UNKNOWN, "LM2.0 Response - user unknown"}, - {LOGON_LM20_ACCOUNT_UPDATE, "LM2.0 Announce account updates"}, - {LOGON_SAM_LOGON_REQUEST, "SAM LOGON request from client"}, - {LOGON_SAM_LOGON_RESPONSE, "Response to SAM LOGON request"}, - {LOGON_SAM_RESPONSE_DURING_LOGON,"SAM Response during LOGON pause"}, - {LOGON_SAM_USER_UNKNOWN, "SAM Response - user unknown"}, - {LOGON_SAM_INTERROGATE_RESPONSE,"SAM Response to Interrogate Request"}, - {LOGON_SAM_AD_USER_UNKNOWN, "SAM Active Directory Response - user unknown"}, - {LOGON_SAM_UNKNOWN_18, "SAM unknown command 0x18"}, - {LOGON_SAM_AD_LOGON_RESPONSE, "Active Directory Response to SAM LOGON request"}, + {LOGON_LM10_LOGON_REQUEST, "LM1.0/LM2.0 LOGON Request"}, + {LOGON_LM10_LOGON_RESPONSE, "LM1.0 LOGON Response"}, + {LOGON_LM10_QUERY_CI, "LM1.0 Query - Centralized Initialization"}, + {LOGON_LM10_QUERY_DI, "LM1.0 Query - Distributed Initialization"}, + {LOGON_LM10_RESPONSE_CI, "LM1.0 Response - Centralized Query"}, + {LOGON_LM10_RESPONSE_DI, "LM1.0 Response - Distributed Initialization"}, + {LOGON_LM20_LOGON_RESPONSE, "LM2.0 Response to LOGON Request"}, + {LOGON_PDC_QUERY, "Query for PDC"}, + {LOGON_PDC_STARTUP, "Announce Startup of PDC"}, + {LOGON_PDC_FAILED, "Announce Failed PDC"}, + {LOGON_UAS_SAM, "Announce Change to UAS or SAM"}, + {LOGON_NO_USER, "Announce no user on machine"}, + {LOGON_PDC_RESPONSE, "Response from PDC"}, + {LOGON_RELOGON_RESPONSE, "LM1.0/LM2.0 Response to re-LOGON Request"}, + {LOGON_INTERROGATE_RESPONSE, "LM1.0/LM2.0 Response to Interrogate Request"}, + {LOGON_LM20_RESPONSE_DURING_LOGON, "LM2.0 Response during LOGON pause"}, + {LOGON_LM20_USER_UNKNOWN, "LM2.0 Response - user unknown"}, + {LOGON_LM20_ACCOUNT_UPDATE, "LM2.0 Announce account updates"}, + {LOGON_SAM_LOGON_REQUEST, "SAM LOGON request from client"}, + {LOGON_SAM_LOGON_RESPONSE, "Response to SAM LOGON request"}, + {LOGON_SAM_RESPONSE_DURING_LOGON, "SAM Response during LOGON pause"}, + {LOGON_SAM_USER_UNKNOWN, "SAM Response - user unknown"}, + {LOGON_SAM_INTERROGATE_RESPONSE, "SAM Response to Interrogate Request"}, + {LOGON_SAM_AD_USER_UNKNOWN, "SAM Active Directory Response - user unknown"}, + {LOGON_SAM_UNKNOWN_18, "SAM unknown command 0x18"}, + {LOGON_SAM_AD_LOGON_RESPONSE, "Active Directory Response to SAM LOGON request"}, {0, NULL} }; static int (*dissect_smb_logon_cmds[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) = { - dissect_smb_logon_request, /* 0x00 (LM1.0/LM2.0 LOGON Request) */ - dissect_smb_logon_LM10_resp,/* 0x01 (LM1.0 LOGON Response) */ - dissect_smb_logon_2, /* 0x02 (LM1.0 Query Centralized Init.)*/ - dissect_smb_logon_2, /* 0x03 (LM1.0 Query Distributed Init.)*/ - dissect_smb_logon_2, /* 0x04 (LM1.0 Centralized Query Resp.)*/ - dissect_smb_logon_2, /* 0x05 (LM1.0 Distributed Query Resp.) */ - dissect_smb_logon_LM20_resp,/* 0x06 (LM2.0 LOGON Response) */ - dissect_smb_pdc_query, /* 0x07 (Query for PDC) */ - dissect_smb_pdc_startup, /* 0x08 (Announce PDC startup) */ - dissect_smb_pdc_failure, /* 0x09 (Announce Failed PDC) */ - dissect_announce_change, /* 0x0A (Announce Change to UAS or SAM)*/ - dissect_smb_no_user, /* 0x0B (Announce no user on machine)*/ - dissect_smb_pdc_startup, /* 0x0C (Response from PDC) */ - dissect_smb_relogon_resp, /* 0x0D (Relogon response) */ - dissect_smb_inter_resp, /* 0x0E (Interrogate response) */ - dissect_smb_pdc_failure, /* 0x0F (LM2.0 Resp. during LOGON pause*/ - dissect_smb_pdc_failure, /* 0x10 (LM 2.0 Unknown user response)*/ - dissect_smb_acc_update, /* 0x11 (LM2.1 Announce Acc updates)*/ - dissect_smb_sam_logon_req, /* 0x12 (SAM LOGON request ) */ - dissect_smb_sam_logon_resp, /* 0x13 (SAM LOGON response) */ - dissect_smb_unknown, /* 0x14 (SAM Response during LOGON Pause) */ - dissect_smb_sam_logon_resp, /* 0x15 (SAM Response User Unknown) */ - dissect_smb_unknown, /* 0x16 (SAM Response to Interrogate)*/ - dissect_smb_pdc_response_ads, /* 0x17 (SAM AD response User Unknown*/ - dissect_smb_unknown, /* 0x18 (Unknown command) */ - dissect_smb_pdc_response_ads /* 0x19 (SAM LOGON AD response) */ + dissect_smb_logon_request, /* 0x00 (LM1.0/LM2.0 LOGON Request) */ + dissect_smb_logon_LM10_resp, /* 0x01 (LM1.0 LOGON Response) */ + dissect_smb_logon_2, /* 0x02 (LM1.0 Query Centralized Init.)*/ + dissect_smb_logon_2, /* 0x03 (LM1.0 Query Distributed Init.)*/ + dissect_smb_logon_2, /* 0x04 (LM1.0 Centralized Query Resp.)*/ + dissect_smb_logon_2, /* 0x05 (LM1.0 Distributed Query Resp.) */ + dissect_smb_logon_LM20_resp, /* 0x06 (LM2.0 LOGON Response) */ + dissect_smb_pdc_query, /* 0x07 (Query for PDC) */ + dissect_smb_pdc_startup, /* 0x08 (Announce PDC startup) */ + dissect_smb_pdc_failure, /* 0x09 (Announce Failed PDC) */ + dissect_announce_change, /* 0x0A (Announce Change to UAS or SAM)*/ + dissect_smb_no_user, /* 0x0B (Announce no user on machine)*/ + dissect_smb_pdc_startup, /* 0x0C (Response from PDC) */ + dissect_smb_relogon_resp, /* 0x0D (Relogon response) */ + dissect_smb_inter_resp, /* 0x0E (Interrogate response) */ + dissect_smb_pdc_failure, /* 0x0F (LM2.0 Resp. during LOGON pause*/ + dissect_smb_pdc_failure, /* 0x10 (LM 2.0 Unknown user response)*/ + dissect_smb_acc_update, /* 0x11 (LM2.1 Announce Acc updates)*/ + dissect_smb_sam_logon_req, /* 0x12 (SAM LOGON request ) */ + dissect_smb_sam_logon_resp, /* 0x13 (SAM LOGON response) */ + dissect_smb_unknown, /* 0x14 (SAM Response during LOGON Pause) */ + dissect_smb_sam_logon_resp, /* 0x15 (SAM Response User Unknown) */ + dissect_smb_unknown, /* 0x16 (SAM Response to Interrogate)*/ + dissect_smb_pdc_response_ads, /* 0x17 (SAM AD response User Unknown*/ + dissect_smb_unknown, /* 0x18 (Unknown command) */ + dissect_smb_pdc_response_ads /* 0x19 (SAM LOGON AD response) */ }; @@ -905,11 +905,11 @@ dissect_smb_logon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_clear(pinfo->cinfo, COL_INFO); /* get the Command field */ - cmd = tvb_get_guint8(tvb, offset); + cmd = tvb_get_guint8(tvb, offset); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(cmd, commands, "Unknown Command:%02x") ); - if (tree) { + if (tree) { item = proto_tree_add_item(tree, proto_smb_logon, tvb, offset, -1, ENC_NA); @@ -1146,11 +1146,24 @@ proto_register_smb_logon( void) &ett_smb_db_info }; - proto_smb_logon = proto_register_protocol( - "Microsoft Windows Logon Protocol (Old)", "SMB_NETLOGON", "smb_netlogon"); + proto_smb_logon = proto_register_protocol( + "Microsoft Windows Logon Protocol (Old)", "SMB_NETLOGON", "smb_netlogon"); proto_register_field_array(proto_smb_logon, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("smb_netlogon", dissect_smb_logon, proto_smb_logon); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c index aff53a548f..5273ebd6ab 100644 --- a/epan/dissectors/packet-sna.c +++ b/epan/dissectors/packet-sna.c @@ -789,14 +789,14 @@ static const value_string sna_control_0e_type_vals[] = { /* Values to direct the top-most dissector what to dissect * after the TH. */ enum next_dissection_enum { - stop_here, - rh_only, - everything + stop_here, + rh_only, + everything }; enum parse { - LT, - KL + LT, + KL }; typedef enum next_dissection_enum next_dissection_t; @@ -1180,7 +1180,7 @@ dissect_optional(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_nlp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - proto_tree *parent_tree) + proto_tree *parent_tree) { proto_tree *nlp_tree, *bf_tree; proto_item *nlp_item, *bf_item; @@ -1508,7 +1508,7 @@ dissect_xid3(tvbuff_t *tvb, proto_tree *tree) static void dissect_xid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - proto_tree *parent_tree) + proto_tree *parent_tree) { proto_tree *sub_tree; proto_item *sub_ti = NULL; @@ -1632,7 +1632,7 @@ mpf_value(guint8 th_byte) */ static tvbuff_t* defragment_by_sequence(packet_info *pinfo, tvbuff_t *tvb, int offset, int mpf, - int id) + int id) { fragment_head *fd_head; int frag_number = -1; @@ -1753,7 +1753,7 @@ dissect_fid0_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* FID Type 2 */ static int dissect_fid2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - tvbuff_t **rh_tvb_ptr, next_dissection_t *continue_dissecting) + tvbuff_t **rh_tvb_ptr, next_dissection_t *continue_dissecting) { proto_tree *bf_tree; proto_item *bf_item; @@ -2109,7 +2109,7 @@ dissect_fidf(tvbuff_t *tvb, proto_tree *tree) static void dissect_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - proto_tree *parent_tree) + proto_tree *parent_tree) { proto_tree *th_tree = NULL, *rh_tree = NULL; @@ -2201,7 +2201,7 @@ dissect_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_text(tree, rh_tvb, rh_offset, -1, "BIU segment data"); return; - } + } call_dissector(data_handle, tvb_new_subset_remaining(rh_tvb, rh_offset), @@ -2308,7 +2308,7 @@ dissect_rh(tvbuff_t *tvb, int offset, proto_tree *tree) static void dissect_control_05hpr(tvbuff_t *tvb, proto_tree *tree, int hpr, - enum parse parse) + enum parse parse) { proto_tree *bf_tree; proto_item *bf_item; @@ -2338,9 +2338,9 @@ dissect_control_05hpr(tvbuff_t *tvb, proto_tree *tree, int hpr, if (len) { dissect_control(tvb, offset, len, tree, hpr, parse); pad = (len+3) & 0xfffc; - if (pad > len) { + if (pad > len) { proto_tree_add_item(tree, hf_sna_padding, tvb, offset+len, pad-len, ENC_NA); - } + } offset += pad; } else { return; @@ -2376,7 +2376,7 @@ dissect_control_0e(tvbuff_t *tvb, proto_tree *tree) static void dissect_control(tvbuff_t *parent_tvb, int offset, int control_len, - proto_tree *tree, int hpr, enum parse parse) + proto_tree *tree, int hpr, enum parse parse) { tvbuff_t *tvb; gint length, reported_length; @@ -2469,7 +2469,7 @@ dissect_control(tvbuff_t *parent_tvb, int offset, int control_len, static void dissect_gds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - proto_tree *parent_tree) + proto_tree *parent_tree) { guint16 length; guint16 type; @@ -2580,887 +2580,887 @@ sna_init(void) void proto_register_sna(void) { - static hf_register_info hf[] = { - { &hf_sna_th, - { "Transmission Header", "sna.th", FT_NONE, BASE_NONE, - NULL, 0x0, NULL, HFILL }}, + static hf_register_info hf[] = { + { &hf_sna_th, + { "Transmission Header", "sna.th", FT_NONE, BASE_NONE, + NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_0, - { "Transmission Header Byte 0", "sna.th.0", FT_UINT8, BASE_HEX, + { &hf_sna_th_0, + { "Transmission Header Byte 0", "sna.th.0", FT_UINT8, BASE_HEX, NULL, 0x0, "TH Byte 0", HFILL }}, - { &hf_sna_th_fid, - { "Format Identifier", "sna.th.fid", FT_UINT8, BASE_HEX, + { &hf_sna_th_fid, + { "Format Identifier", "sna.th.fid", FT_UINT8, BASE_HEX, VALS(sna_th_fid_vals), 0xf0, NULL, HFILL }}, - { &hf_sna_th_mpf, - { "Mapping Field", "sna.th.mpf", FT_UINT8, + { &hf_sna_th_mpf, + { "Mapping Field", "sna.th.mpf", FT_UINT8, BASE_DEC, VALS(sna_th_mpf_vals), 0x0c, NULL, HFILL }}, { &hf_sna_th_odai, - { "ODAI Assignment Indicator", "sna.th.odai", FT_UINT8, + { "ODAI Assignment Indicator", "sna.th.odai", FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }}, - { &hf_sna_th_efi, - { "Expedited Flow Indicator", "sna.th.efi", FT_UINT8, + { &hf_sna_th_efi, + { "Expedited Flow Indicator", "sna.th.efi", FT_UINT8, BASE_DEC, VALS(sna_th_efi_vals), 0x01, NULL, HFILL }}, - { &hf_sna_th_daf, - { "Destination Address Field", "sna.th.daf", FT_UINT16, + { &hf_sna_th_daf, + { "Destination Address Field", "sna.th.daf", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_oaf, - { "Origin Address Field", "sna.th.oaf", FT_UINT16, BASE_HEX, + { &hf_sna_th_oaf, + { "Origin Address Field", "sna.th.oaf", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_snf, - { "Sequence Number Field", "sna.th.snf", FT_UINT16, BASE_DEC, + { &hf_sna_th_snf, + { "Sequence Number Field", "sna.th.snf", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_dcf, - { "Data Count Field", "sna.th.dcf", FT_UINT16, BASE_DEC, + { &hf_sna_th_dcf, + { "Data Count Field", "sna.th.dcf", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_lsid, - { "Local Session Identification", "sna.th.lsid", FT_UINT8, + { &hf_sna_th_lsid, + { "Local Session Identification", "sna.th.lsid", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_tg_sweep, - { "Transmission Group Sweep", "sna.th.tg_sweep", FT_UINT8, + { &hf_sna_th_tg_sweep, + { "Transmission Group Sweep", "sna.th.tg_sweep", FT_UINT8, BASE_DEC, VALS(sna_th_tg_sweep_vals), 0x08, NULL, HFILL }}, - { &hf_sna_th_er_vr_supp_ind, - { "ER and VR Support Indicator", "sna.th.er_vr_supp_ind", + { &hf_sna_th_er_vr_supp_ind, + { "ER and VR Support Indicator", "sna.th.er_vr_supp_ind", FT_UINT8, BASE_DEC, VALS(sna_th_er_vr_supp_ind_vals), 0x04, NULL, HFILL }}, - { &hf_sna_th_vr_pac_cnt_ind, - { "Virtual Route Pacing Count Indicator", + { &hf_sna_th_vr_pac_cnt_ind, + { "Virtual Route Pacing Count Indicator", "sna.th.vr_pac_cnt_ind", FT_UINT8, BASE_DEC, VALS(sna_th_vr_pac_cnt_ind_vals), 0x02, NULL, HFILL }}, - { &hf_sna_th_ntwk_prty, - { "Network Priority", "sna.th.ntwk_prty", FT_UINT8, BASE_DEC, + { &hf_sna_th_ntwk_prty, + { "Network Priority", "sna.th.ntwk_prty", FT_UINT8, BASE_DEC, VALS(sna_th_ntwk_prty_vals), 0x01, NULL, HFILL }}, - { &hf_sna_th_tgsf, - { "Transmission Group Segmenting Field", "sna.th.tgsf", + { &hf_sna_th_tgsf, + { "Transmission Group Segmenting Field", "sna.th.tgsf", FT_UINT8, BASE_HEX, VALS(sna_th_tgsf_vals), 0xc0, NULL, HFILL }}, - { &hf_sna_th_mft, - { "MPR FID4 Type", "sna.th.mft", FT_BOOLEAN, 8, + { &hf_sna_th_mft, + { "MPR FID4 Type", "sna.th.mft", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - { &hf_sna_th_piubf, - { "PIU Blocking Field", "sna.th.piubf", FT_UINT8, BASE_HEX, + { &hf_sna_th_piubf, + { "PIU Blocking Field", "sna.th.piubf", FT_UINT8, BASE_HEX, VALS(sna_th_piubf_vals), 0x03, NULL, HFILL }}, - { &hf_sna_th_iern, - { "Initial Explicit Route Number", "sna.th.iern", FT_UINT8, + { &hf_sna_th_iern, + { "Initial Explicit Route Number", "sna.th.iern", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }}, - { &hf_sna_th_nlpoi, - { "NLP Offset Indicator", "sna.th.nlpoi", FT_UINT8, BASE_DEC, + { &hf_sna_th_nlpoi, + { "NLP Offset Indicator", "sna.th.nlpoi", FT_UINT8, BASE_DEC, VALS(sna_th_nlpoi_vals), 0x80, NULL, HFILL }}, - { &hf_sna_th_nlp_cp, - { "NLP Count or Padding", "sna.th.nlp_cp", FT_UINT8, BASE_DEC, + { &hf_sna_th_nlp_cp, + { "NLP Count or Padding", "sna.th.nlp_cp", FT_UINT8, BASE_DEC, NULL, 0x70, NULL, HFILL }}, - { &hf_sna_th_ern, - { "Explicit Route Number", "sna.th.ern", FT_UINT8, BASE_DEC, + { &hf_sna_th_ern, + { "Explicit Route Number", "sna.th.ern", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL }}, - { &hf_sna_th_vrn, - { "Virtual Route Number", "sna.th.vrn", FT_UINT8, BASE_DEC, + { &hf_sna_th_vrn, + { "Virtual Route Number", "sna.th.vrn", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }}, - { &hf_sna_th_tpf, - { "Transmission Priority Field", "sna.th.tpf", FT_UINT8, + { &hf_sna_th_tpf, + { "Transmission Priority Field", "sna.th.tpf", FT_UINT8, BASE_HEX, VALS(sna_th_tpf_vals), 0x03, NULL, HFILL }}, - { &hf_sna_th_vr_cwi, - { "Virtual Route Change Window Indicator", "sna.th.vr_cwi", + { &hf_sna_th_vr_cwi, + { "Virtual Route Change Window Indicator", "sna.th.vr_cwi", FT_UINT16, BASE_DEC, VALS(sna_th_vr_cwi_vals), 0x8000, "Change Window Indicator", HFILL }}, - { &hf_sna_th_tg_nonfifo_ind, - { "Transmission Group Non-FIFO Indicator", + { &hf_sna_th_tg_nonfifo_ind, + { "Transmission Group Non-FIFO Indicator", "sna.th.tg_nonfifo_ind", FT_BOOLEAN, 16, TFS(&sna_th_tg_nonfifo_ind_truth), 0x4000, NULL, HFILL }}, - { &hf_sna_th_vr_sqti, - { "Virtual Route Sequence and Type Indicator", "sna.th.vr_sqti", + { &hf_sna_th_vr_sqti, + { "Virtual Route Sequence and Type Indicator", "sna.th.vr_sqti", FT_UINT16, BASE_HEX, VALS(sna_th_vr_sqti_vals), 0x3000, "Route Sequence and Type", HFILL }}, - { &hf_sna_th_tg_snf, - { "Transmission Group Sequence Number Field", "sna.th.tg_snf", + { &hf_sna_th_tg_snf, + { "Transmission Group Sequence Number Field", "sna.th.tg_snf", FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }}, - { &hf_sna_th_vrprq, - { "Virtual Route Pacing Request", "sna.th.vrprq", FT_BOOLEAN, + { &hf_sna_th_vrprq, + { "Virtual Route Pacing Request", "sna.th.vrprq", FT_BOOLEAN, 16, TFS(&sna_th_vrprq_truth), 0x8000, NULL, HFILL }}, - { &hf_sna_th_vrprs, - { "Virtual Route Pacing Response", "sna.th.vrprs", FT_BOOLEAN, + { &hf_sna_th_vrprs, + { "Virtual Route Pacing Response", "sna.th.vrprs", FT_BOOLEAN, 16, TFS(&sna_th_vrprs_truth), 0x4000, NULL, HFILL }}, - { &hf_sna_th_vr_cwri, - { "Virtual Route Change Window Reply Indicator", + { &hf_sna_th_vr_cwri, + { "Virtual Route Change Window Reply Indicator", "sna.th.vr_cwri", FT_UINT16, BASE_DEC, VALS(sna_th_vr_cwri_vals), 0x2000, NULL, HFILL }}, - { &hf_sna_th_vr_rwi, - { "Virtual Route Reset Window Indicator", "sna.th.vr_rwi", + { &hf_sna_th_vr_rwi, + { "Virtual Route Reset Window Indicator", "sna.th.vr_rwi", FT_BOOLEAN, 16, TFS(&sna_th_vr_rwi_truth), 0x1000, NULL, HFILL }}, - { &hf_sna_th_vr_snf_send, - { "Virtual Route Send Sequence Number Field", + { &hf_sna_th_vr_snf_send, + { "Virtual Route Send Sequence Number Field", "sna.th.vr_snf_send", FT_UINT16, BASE_DEC, NULL, 0x0fff, "Send Sequence Number Field", HFILL }}, - { &hf_sna_th_dsaf, - { "Destination Subarea Address Field", "sna.th.dsaf", + { &hf_sna_th_dsaf, + { "Destination Subarea Address Field", "sna.th.dsaf", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_osaf, - { "Origin Subarea Address Field", "sna.th.osaf", FT_UINT32, + { &hf_sna_th_osaf, + { "Origin Subarea Address Field", "sna.th.osaf", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_snai, - { "SNA Indicator", "sna.th.snai", FT_BOOLEAN, 8, NULL, 0x10, + { &hf_sna_th_snai, + { "SNA Indicator", "sna.th.snai", FT_BOOLEAN, 8, NULL, 0x10, "Used to identify whether the PIU originated or is destined for an SNA or non-SNA device.", HFILL }}, - { &hf_sna_th_def, - { "Destination Element Field", "sna.th.def", FT_UINT16, + { &hf_sna_th_def, + { "Destination Element Field", "sna.th.def", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_oef, - { "Origin Element Field", "sna.th.oef", FT_UINT16, BASE_HEX, + { &hf_sna_th_oef, + { "Origin Element Field", "sna.th.oef", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_sa, - { "Session Address", "sna.th.sa", FT_BYTES, BASE_NONE, + { &hf_sna_th_sa, + { "Session Address", "sna.th.sa", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_cmd_fmt, - { "Command Format", "sna.th.cmd_fmt", FT_UINT8, BASE_HEX, + { &hf_sna_th_cmd_fmt, + { "Command Format", "sna.th.cmd_fmt", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_cmd_type, - { "Command Type", "sna.th.cmd_type", FT_UINT8, BASE_HEX, + { &hf_sna_th_cmd_type, + { "Command Type", "sna.th.cmd_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_th_cmd_sn, - { "Command Sequence Number", "sna.th.cmd_sn", FT_UINT16, + { &hf_sna_th_cmd_sn, + { "Command Sequence Number", "sna.th.cmd_sn", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_nhdr, - { "Network Layer Packet Header", "sna.nlp.nhdr", FT_NONE, + { &hf_sna_nlp_nhdr, + { "Network Layer Packet Header", "sna.nlp.nhdr", FT_NONE, BASE_NONE, NULL, 0x0, "NHDR", HFILL }}, - { &hf_sna_nlp_nhdr_0, - { "Network Layer Packet Header Byte 0", "sna.nlp.nhdr.0", + { &hf_sna_nlp_nhdr_0, + { "Network Layer Packet Header Byte 0", "sna.nlp.nhdr.0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_nhdr_1, - { "Network Layer Packet Header Byte 1", "sna.nlp.nhdr.1", + { &hf_sna_nlp_nhdr_1, + { "Network Layer Packet Header Byte 1", "sna.nlp.nhdr.1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_sm, - { "Switching Mode Field", "sna.nlp.nhdr.sm", FT_UINT8, + { &hf_sna_nlp_sm, + { "Switching Mode Field", "sna.nlp.nhdr.sm", FT_UINT8, BASE_HEX, VALS(sna_nlp_sm_vals), 0xe0, NULL, HFILL }}, - { &hf_sna_nlp_tpf, - { "Transmission Priority Field", "sna.nlp.nhdr.tpf", FT_UINT8, + { &hf_sna_nlp_tpf, + { "Transmission Priority Field", "sna.nlp.nhdr.tpf", FT_UINT8, BASE_HEX, VALS(sna_th_tpf_vals), 0x06, NULL, HFILL }}, - { &hf_sna_nlp_ft, - { "Function Type", "sna.nlp.nhdr.ft", FT_UINT8, BASE_HEX, + { &hf_sna_nlp_ft, + { "Function Type", "sna.nlp.nhdr.ft", FT_UINT8, BASE_HEX, VALS(sna_nlp_ft_vals), 0xF0, NULL, HFILL }}, - { &hf_sna_nlp_tspi, - { "Time Sensitive Packet Indicator", "sna.nlp.nhdr.tspi", + { &hf_sna_nlp_tspi, + { "Time Sensitive Packet Indicator", "sna.nlp.nhdr.tspi", FT_BOOLEAN, 8, TFS(&sna_nlp_tspi_truth), 0x08, NULL, HFILL }}, - { &hf_sna_nlp_slowdn1, - { "Slowdown 1", "sna.nlp.nhdr.slowdn1", FT_BOOLEAN, 8, + { &hf_sna_nlp_slowdn1, + { "Slowdown 1", "sna.nlp.nhdr.slowdn1", FT_BOOLEAN, 8, TFS(&sna_nlp_slowdn1_truth), 0x04, NULL, HFILL }}, - { &hf_sna_nlp_slowdn2, - { "Slowdown 2", "sna.nlp.nhdr.slowdn2", FT_BOOLEAN, 8, + { &hf_sna_nlp_slowdn2, + { "Slowdown 2", "sna.nlp.nhdr.slowdn2", FT_BOOLEAN, 8, TFS(&sna_nlp_slowdn2_truth), 0x02, NULL, HFILL }}, - { &hf_sna_nlp_fra, - { "Function Routing Address Entry", "sna.nlp.nhdr.fra", + { &hf_sna_nlp_fra, + { "Function Routing Address Entry", "sna.nlp.nhdr.fra", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, - { &hf_sna_nlp_anr, - { "Automatic Network Routing Entry", "sna.nlp.nhdr.anr", + { &hf_sna_nlp_anr, + { "Automatic Network Routing Entry", "sna.nlp.nhdr.anr", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, - { &hf_sna_nlp_frh, - { "Transmission Priority Field", "sna.nlp.frh", FT_UINT8, + { &hf_sna_nlp_frh, + { "Transmission Priority Field", "sna.nlp.frh", FT_UINT8, BASE_HEX, VALS(sna_nlp_frh_vals), 0, NULL, HFILL }}, - { &hf_sna_nlp_thdr, - { "RTP Transport Header", "sna.nlp.thdr", FT_NONE, BASE_NONE, + { &hf_sna_nlp_thdr, + { "RTP Transport Header", "sna.nlp.thdr", FT_NONE, BASE_NONE, NULL, 0x0, "THDR", HFILL }}, - { &hf_sna_nlp_tcid, - { "Transport Connection Identifier", "sna.nlp.thdr.tcid", + { &hf_sna_nlp_tcid, + { "Transport Connection Identifier", "sna.nlp.thdr.tcid", FT_BYTES, BASE_NONE, NULL, 0x0, "TCID", HFILL }}, - { &hf_sna_nlp_thdr_8, - { "RTP Transport Packet Header Byte 8", "sna.nlp.thdr.8", + { &hf_sna_nlp_thdr_8, + { "RTP Transport Packet Header Byte 8", "sna.nlp.thdr.8", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_setupi, - { "Setup Indicator", "sna.nlp.thdr.setupi", FT_BOOLEAN, 8, + { &hf_sna_nlp_setupi, + { "Setup Indicator", "sna.nlp.thdr.setupi", FT_BOOLEAN, 8, TFS(&sna_nlp_setupi_truth), 0x40, NULL, HFILL }}, - { &hf_sna_nlp_somi, - { "Start Of Message Indicator", "sna.nlp.thdr.somi", + { &hf_sna_nlp_somi, + { "Start Of Message Indicator", "sna.nlp.thdr.somi", FT_BOOLEAN, 8, TFS(&sna_nlp_somi_truth), 0x20, NULL, HFILL }}, - { &hf_sna_nlp_eomi, - { "End Of Message Indicator", "sna.nlp.thdr.eomi", FT_BOOLEAN, + { &hf_sna_nlp_eomi, + { "End Of Message Indicator", "sna.nlp.thdr.eomi", FT_BOOLEAN, 8, TFS(&sna_nlp_eomi_truth), 0x10, NULL, HFILL }}, - { &hf_sna_nlp_sri, - { "Session Request Indicator", "sna.nlp.thdr.sri", FT_BOOLEAN, + { &hf_sna_nlp_sri, + { "Session Request Indicator", "sna.nlp.thdr.sri", FT_BOOLEAN, 8, TFS(&sna_nlp_sri_truth), 0x08, NULL, HFILL }}, - { &hf_sna_nlp_rasapi, - { "Reply ASAP Indicator", "sna.nlp.thdr.rasapi", FT_BOOLEAN, + { &hf_sna_nlp_rasapi, + { "Reply ASAP Indicator", "sna.nlp.thdr.rasapi", FT_BOOLEAN, 8, TFS(&sna_nlp_rasapi_truth), 0x04, NULL, HFILL }}, - { &hf_sna_nlp_retryi, - { "Retry Indicator", "sna.nlp.thdr.retryi", FT_BOOLEAN, + { &hf_sna_nlp_retryi, + { "Retry Indicator", "sna.nlp.thdr.retryi", FT_BOOLEAN, 8, TFS(&sna_nlp_retryi_truth), 0x02, NULL, HFILL }}, - { &hf_sna_nlp_thdr_9, - { "RTP Transport Packet Header Byte 9", "sna.nlp.thdr.9", + { &hf_sna_nlp_thdr_9, + { "RTP Transport Packet Header Byte 9", "sna.nlp.thdr.9", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_lmi, - { "Last Message Indicator", "sna.nlp.thdr.lmi", FT_BOOLEAN, + { &hf_sna_nlp_lmi, + { "Last Message Indicator", "sna.nlp.thdr.lmi", FT_BOOLEAN, 8, TFS(&sna_nlp_lmi_truth), 0x80, NULL, HFILL }}, - { &hf_sna_nlp_cqfi, - { "Connection Qualifier Field Indicator", "sna.nlp.thdr.cqfi", + { &hf_sna_nlp_cqfi, + { "Connection Qualifier Field Indicator", "sna.nlp.thdr.cqfi", FT_BOOLEAN, 8, TFS(&sna_nlp_cqfi_truth), 0x08, NULL, HFILL }}, - { &hf_sna_nlp_osi, - { "Optional Segments Present Indicator", "sna.nlp.thdr.osi", + { &hf_sna_nlp_osi, + { "Optional Segments Present Indicator", "sna.nlp.thdr.osi", FT_BOOLEAN, 8, TFS(&sna_nlp_osi_truth), 0x04, NULL, HFILL }}, - { &hf_sna_nlp_offset, - { "Data Offset/4", "sna.nlp.thdr.offset", FT_UINT16, BASE_HEX, + { &hf_sna_nlp_offset, + { "Data Offset/4", "sna.nlp.thdr.offset", FT_UINT16, BASE_HEX, NULL, 0x0, "Data Offset in Words", HFILL }}, - { &hf_sna_nlp_dlf, - { "Data Length Field", "sna.nlp.thdr.dlf", FT_UINT32, BASE_HEX, + { &hf_sna_nlp_dlf, + { "Data Length Field", "sna.nlp.thdr.dlf", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_bsn, - { "Byte Sequence Number", "sna.nlp.thdr.bsn", FT_UINT32, + { &hf_sna_nlp_bsn, + { "Byte Sequence Number", "sna.nlp.thdr.bsn", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_len, - { "Optional Segment Length/4", "sna.nlp.thdr.optional.len", + { &hf_sna_nlp_opti_len, + { "Optional Segment Length/4", "sna.nlp.thdr.optional.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_type, - { "Optional Segment Type", "sna.nlp.thdr.optional.type", + { &hf_sna_nlp_opti_type, + { "Optional Segment Type", "sna.nlp.thdr.optional.type", FT_UINT8, BASE_HEX, VALS(sna_nlp_opti_vals), 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_0d_version, - { "Version", "sna.nlp.thdr.optional.0d.version", + { &hf_sna_nlp_opti_0d_version, + { "Version", "sna.nlp.thdr.optional.0d.version", FT_UINT16, BASE_HEX, VALS(sna_nlp_opti_0d_version_vals), 0, NULL, HFILL }}, - { &hf_sna_nlp_opti_0d_4, - { "Connection Setup Byte 4", "sna.nlp.thdr.optional.0e.4", + { &hf_sna_nlp_opti_0d_4, + { "Connection Setup Byte 4", "sna.nlp.thdr.optional.0e.4", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, - { &hf_sna_nlp_opti_0d_target, - { "Target Resource ID Present", + { &hf_sna_nlp_opti_0d_target, + { "Target Resource ID Present", "sna.nlp.thdr.optional.0d.target", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, - { &hf_sna_nlp_opti_0d_arb, - { "ARB Flow Control", "sna.nlp.thdr.optional.0d.arb", + { &hf_sna_nlp_opti_0d_arb, + { "ARB Flow Control", "sna.nlp.thdr.optional.0d.arb", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, - { &hf_sna_nlp_opti_0d_reliable, - { "Reliable Connection", "sna.nlp.thdr.optional.0d.reliable", + { &hf_sna_nlp_opti_0d_reliable, + { "Reliable Connection", "sna.nlp.thdr.optional.0d.reliable", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, - { &hf_sna_nlp_opti_0d_dedicated, - { "Dedicated RTP Connection", + { &hf_sna_nlp_opti_0d_dedicated, + { "Dedicated RTP Connection", "sna.nlp.thdr.optional.0d.dedicated", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - { &hf_sna_nlp_opti_0e_stat, - { "Status", "sna.nlp.thdr.optional.0e.stat", + { &hf_sna_nlp_opti_0e_stat, + { "Status", "sna.nlp.thdr.optional.0e.stat", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, - { &hf_sna_nlp_opti_0e_gap, - { "Gap Detected", "sna.nlp.thdr.optional.0e.gap", + { &hf_sna_nlp_opti_0e_gap, + { "Gap Detected", "sna.nlp.thdr.optional.0e.gap", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, - { &hf_sna_nlp_opti_0e_idle, - { "RTP Idle Packet", "sna.nlp.thdr.optional.0e.idle", + { &hf_sna_nlp_opti_0e_idle, + { "RTP Idle Packet", "sna.nlp.thdr.optional.0e.idle", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, - { &hf_sna_nlp_opti_0e_nabsp, - { "Number Of ABSP", "sna.nlp.thdr.optional.0e.nabsp", + { &hf_sna_nlp_opti_0e_nabsp, + { "Number Of ABSP", "sna.nlp.thdr.optional.0e.nabsp", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_0e_sync, - { "Status Report Number", "sna.nlp.thdr.optional.0e.sync", + { &hf_sna_nlp_opti_0e_sync, + { "Status Report Number", "sna.nlp.thdr.optional.0e.sync", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_0e_echo, - { "Status Acknowledge Number", "sna.nlp.thdr.optional.0e.echo", + { &hf_sna_nlp_opti_0e_echo, + { "Status Acknowledge Number", "sna.nlp.thdr.optional.0e.echo", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_0e_rseq, - { "Received Sequence Number", "sna.nlp.thdr.optional.0e.rseq", + { &hf_sna_nlp_opti_0e_rseq, + { "Received Sequence Number", "sna.nlp.thdr.optional.0e.rseq", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, #if 0 - { &hf_sna_nlp_opti_0e_abspbeg, - { "ABSP Begin", "sna.nlp.thdr.optional.0e.abspbeg", + { &hf_sna_nlp_opti_0e_abspbeg, + { "ABSP Begin", "sna.nlp.thdr.optional.0e.abspbeg", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, #endif #if 0 - { &hf_sna_nlp_opti_0e_abspend, - { "ABSP End", "sna.nlp.thdr.optional.0e.abspend", + { &hf_sna_nlp_opti_0e_abspend, + { "ABSP End", "sna.nlp.thdr.optional.0e.abspend", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, #endif - { &hf_sna_nlp_opti_0f_bits, - { "Client Bits", "sna.nlp.thdr.optional.0f.bits", + { &hf_sna_nlp_opti_0f_bits, + { "Client Bits", "sna.nlp.thdr.optional.0f.bits", FT_UINT8, BASE_HEX, VALS(sna_nlp_opti_0f_bits_vals), 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_10_tcid, - { "Transport Connection Identifier", + { &hf_sna_nlp_opti_10_tcid, + { "Transport Connection Identifier", "sna.nlp.thdr.optional.10.tcid", FT_BYTES, BASE_NONE, NULL, 0x0, "TCID", HFILL }}, - { &hf_sna_nlp_opti_12_sense, - { "Sense Data", "sna.nlp.thdr.optional.12.sense", + { &hf_sna_nlp_opti_12_sense, + { "Sense Data", "sna.nlp.thdr.optional.12.sense", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_len, - { "Length", "sna.nlp.thdr.optional.14.si.len", + { &hf_sna_nlp_opti_14_si_len, + { "Length", "sna.nlp.thdr.optional.14.si.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_key, - { "Key", "sna.nlp.thdr.optional.14.si.key", + { &hf_sna_nlp_opti_14_si_key, + { "Key", "sna.nlp.thdr.optional.14.si.key", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_2, - { "Switching Information Byte 2", + { &hf_sna_nlp_opti_14_si_2, + { "Switching Information Byte 2", "sna.nlp.thdr.optional.14.si.2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_refifo, - { "Resequencing (REFIFO) Indicator", + { &hf_sna_nlp_opti_14_si_refifo, + { "Resequencing (REFIFO) Indicator", "sna.nlp.thdr.optional.14.si.refifo", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_mobility, - { "Mobility Indicator", + { &hf_sna_nlp_opti_14_si_mobility, + { "Mobility Indicator", "sna.nlp.thdr.optional.14.si.mobility", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_dirsearch, - { "Directory Search Required on Path Switch Indicator", + { &hf_sna_nlp_opti_14_si_dirsearch, + { "Directory Search Required on Path Switch Indicator", "sna.nlp.thdr.optional.14.si.dirsearch", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_limitres, - { "Limited Resource Link Indicator", + { &hf_sna_nlp_opti_14_si_limitres, + { "Limited Resource Link Indicator", "sna.nlp.thdr.optional.14.si.limitres", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_ncescope, - { "NCE Scope Indicator", + { &hf_sna_nlp_opti_14_si_ncescope, + { "NCE Scope Indicator", "sna.nlp.thdr.optional.14.si.ncescope", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_mnpsrscv, - { "MNPS RSCV Retention Indicator", + { &hf_sna_nlp_opti_14_si_mnpsrscv, + { "MNPS RSCV Retention Indicator", "sna.nlp.thdr.optional.14.si.mnpsrscv", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_maxpsize, - { "Maximum Packet Size On Return Path", + { &hf_sna_nlp_opti_14_si_maxpsize, + { "Maximum Packet Size On Return Path", "sna.nlp.thdr.optional.14.si.maxpsize", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_switch, - { "Path Switch Time", "sna.nlp.thdr.optional.14.si.switch", + { &hf_sna_nlp_opti_14_si_switch, + { "Path Switch Time", "sna.nlp.thdr.optional.14.si.switch", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_si_alive, - { "RTP Alive Timer", "sna.nlp.thdr.optional.14.si.alive", + { &hf_sna_nlp_opti_14_si_alive, + { "RTP Alive Timer", "sna.nlp.thdr.optional.14.si.alive", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_rr_len, - { "Length", "sna.nlp.thdr.optional.14.rr.len", + { &hf_sna_nlp_opti_14_rr_len, + { "Length", "sna.nlp.thdr.optional.14.rr.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_rr_key, - { "Key", "sna.nlp.thdr.optional.14.rr.key", + { &hf_sna_nlp_opti_14_rr_key, + { "Key", "sna.nlp.thdr.optional.14.rr.key", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_rr_2, - { "Return Route TG Descriptor Byte 2", + { &hf_sna_nlp_opti_14_rr_2, + { "Return Route TG Descriptor Byte 2", "sna.nlp.thdr.optional.14.rr.2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_rr_bfe, - { "BF Entry Indicator", + { &hf_sna_nlp_opti_14_rr_bfe, + { "BF Entry Indicator", "sna.nlp.thdr.optional.14.rr.bfe", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, - { &hf_sna_nlp_opti_14_rr_num, - { "Number Of TG Control Vectors", + { &hf_sna_nlp_opti_14_rr_num, + { "Number Of TG Control Vectors", "sna.nlp.thdr.optional.14.rr.num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_2, - { "Adaptive Rate Based Segment Byte 2", + { &hf_sna_nlp_opti_22_2, + { "Adaptive Rate Based Segment Byte 2", "sna.nlp.thdr.optional.22.2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_type, - { "Message Type", + { &hf_sna_nlp_opti_22_type, + { "Message Type", "sna.nlp.thdr.optional.22.type", FT_UINT8, BASE_HEX, VALS(sna_nlp_opti_22_type_vals), 0xc0, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_raa, - { "Rate Adjustment Action", + { &hf_sna_nlp_opti_22_raa, + { "Rate Adjustment Action", "sna.nlp.thdr.optional.22.raa", FT_UINT8, BASE_HEX, VALS(sna_nlp_opti_22_raa_vals), 0x38, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_parity, - { "Parity Indicator", + { &hf_sna_nlp_opti_22_parity, + { "Parity Indicator", "sna.nlp.thdr.optional.22.parity", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_arb, - { "ARB Mode", + { &hf_sna_nlp_opti_22_arb, + { "ARB Mode", "sna.nlp.thdr.optional.22.arb", FT_UINT8, BASE_HEX, VALS(sna_nlp_opti_22_arb_vals), 0x03, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_3, - { "Adaptive Rate Based Segment Byte 3", + { &hf_sna_nlp_opti_22_3, + { "Adaptive Rate Based Segment Byte 3", "sna.nlp.thdr.optional.22.3", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_ratereq, - { "Rate Request Correlator", + { &hf_sna_nlp_opti_22_ratereq, + { "Rate Request Correlator", "sna.nlp.thdr.optional.22.ratereq", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_raterep, - { "Rate Reply Correlator", + { &hf_sna_nlp_opti_22_raterep, + { "Rate Reply Correlator", "sna.nlp.thdr.optional.22.raterep", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_field1, - { "Field 1", "sna.nlp.thdr.optional.22.field1", + { &hf_sna_nlp_opti_22_field1, + { "Field 1", "sna.nlp.thdr.optional.22.field1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_field2, - { "Field 2", "sna.nlp.thdr.optional.22.field2", + { &hf_sna_nlp_opti_22_field2, + { "Field 2", "sna.nlp.thdr.optional.22.field2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_field3, - { "Field 3", "sna.nlp.thdr.optional.22.field3", + { &hf_sna_nlp_opti_22_field3, + { "Field 3", "sna.nlp.thdr.optional.22.field3", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_nlp_opti_22_field4, - { "Field 4", "sna.nlp.thdr.optional.22.field4", + { &hf_sna_nlp_opti_22_field4, + { "Field 4", "sna.nlp.thdr.optional.22.field4", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_rh, - { "Request/Response Header", "sna.rh", FT_NONE, BASE_NONE, + { &hf_sna_rh, + { "Request/Response Header", "sna.rh", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_rh_0, - { "Request/Response Header Byte 0", "sna.rh.0", FT_UINT8, + { &hf_sna_rh_0, + { "Request/Response Header Byte 0", "sna.rh.0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_rh_1, - { "Request/Response Header Byte 1", "sna.rh.1", FT_UINT8, + { &hf_sna_rh_1, + { "Request/Response Header Byte 1", "sna.rh.1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_rh_2, - { "Request/Response Header Byte 2", "sna.rh.2", FT_UINT8, + { &hf_sna_rh_2, + { "Request/Response Header Byte 2", "sna.rh.2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_rh_rri, - { "Request/Response Indicator", "sna.rh.rri", FT_UINT8, + { &hf_sna_rh_rri, + { "Request/Response Indicator", "sna.rh.rri", FT_UINT8, BASE_DEC, VALS(sna_rh_rri_vals), 0x80, NULL, HFILL }}, - { &hf_sna_rh_ru_category, - { "Request/Response Unit Category", "sna.rh.ru_category", + { &hf_sna_rh_ru_category, + { "Request/Response Unit Category", "sna.rh.ru_category", FT_UINT8, BASE_HEX, VALS(sna_rh_ru_category_vals), 0x60, NULL, HFILL }}, { &hf_sna_rh_fi, - { "Format Indicator", "sna.rh.fi", FT_BOOLEAN, 8, + { "Format Indicator", "sna.rh.fi", FT_BOOLEAN, 8, TFS(&sna_rh_fi_truth), 0x08, NULL, HFILL }}, { &hf_sna_rh_sdi, - { "Sense Data Included", "sna.rh.sdi", FT_BOOLEAN, 8, + { "Sense Data Included", "sna.rh.sdi", FT_BOOLEAN, 8, TFS(&sna_rh_sdi_truth), 0x04, NULL, HFILL }}, { &hf_sna_rh_bci, - { "Begin Chain Indicator", "sna.rh.bci", FT_BOOLEAN, 8, + { "Begin Chain Indicator", "sna.rh.bci", FT_BOOLEAN, 8, TFS(&sna_rh_bci_truth), 0x02, NULL, HFILL }}, { &hf_sna_rh_eci, - { "End Chain Indicator", "sna.rh.eci", FT_BOOLEAN, 8, + { "End Chain Indicator", "sna.rh.eci", FT_BOOLEAN, 8, TFS(&sna_rh_eci_truth), 0x01, NULL, HFILL }}, { &hf_sna_rh_dr1, - { "Definite Response 1 Indicator", "sna.rh.dr1", FT_BOOLEAN, + { "Definite Response 1 Indicator", "sna.rh.dr1", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_sna_rh_lcci, - { "Length-Checked Compression Indicator", "sna.rh.lcci", + { "Length-Checked Compression Indicator", "sna.rh.lcci", FT_BOOLEAN, 8, TFS(&sna_rh_lcci_truth), 0x40, NULL, HFILL }}, { &hf_sna_rh_dr2, - { "Definite Response 2 Indicator", "sna.rh.dr2", FT_BOOLEAN, + { "Definite Response 2 Indicator", "sna.rh.dr2", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_sna_rh_eri, - { "Exception Response Indicator", "sna.rh.eri", FT_BOOLEAN, + { "Exception Response Indicator", "sna.rh.eri", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_sna_rh_rti, - { "Response Type Indicator", "sna.rh.rti", FT_BOOLEAN, + { "Response Type Indicator", "sna.rh.rti", FT_BOOLEAN, 8, TFS(&sna_rh_rti_truth), 0x10, NULL, HFILL }}, { &hf_sna_rh_rlwi, - { "Request Larger Window Indicator", "sna.rh.rlwi", FT_BOOLEAN, + { "Request Larger Window Indicator", "sna.rh.rlwi", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_sna_rh_qri, - { "Queued Response Indicator", "sna.rh.qri", FT_BOOLEAN, + { "Queued Response Indicator", "sna.rh.qri", FT_BOOLEAN, 8, TFS(&sna_rh_qri_truth), 0x02, NULL, HFILL }}, { &hf_sna_rh_pi, - { "Pacing Indicator", "sna.rh.pi", FT_BOOLEAN, + { "Pacing Indicator", "sna.rh.pi", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_sna_rh_bbi, - { "Begin Bracket Indicator", "sna.rh.bbi", FT_BOOLEAN, + { "Begin Bracket Indicator", "sna.rh.bbi", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_sna_rh_ebi, - { "End Bracket Indicator", "sna.rh.ebi", FT_BOOLEAN, + { "End Bracket Indicator", "sna.rh.ebi", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_sna_rh_cdi, - { "Change Direction Indicator", "sna.rh.cdi", FT_BOOLEAN, + { "Change Direction Indicator", "sna.rh.cdi", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_sna_rh_csi, - { "Code Selection Indicator", "sna.rh.csi", FT_UINT8, BASE_DEC, + { "Code Selection Indicator", "sna.rh.csi", FT_UINT8, BASE_DEC, VALS(sna_rh_csi_vals), 0x08, NULL, HFILL }}, { &hf_sna_rh_edi, - { "Enciphered Data Indicator", "sna.rh.edi", FT_BOOLEAN, 8, + { "Enciphered Data Indicator", "sna.rh.edi", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_sna_rh_pdi, - { "Padded Data Indicator", "sna.rh.pdi", FT_BOOLEAN, 8, NULL, + { "Padded Data Indicator", "sna.rh.pdi", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_sna_rh_cebi, - { "Conditional End Bracket Indicator", "sna.rh.cebi", + { "Conditional End Bracket Indicator", "sna.rh.cebi", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, /* { &hf_sna_ru, { "Request/Response Unit", "sna.ru", FT_NONE, BASE_NONE, - NULL, 0x0, NULL, HFILL }},*/ + NULL, 0x0, NULL, HFILL }},*/ { &hf_sna_gds, - { "GDS Variable", "sna.gds", FT_NONE, BASE_NONE, NULL, 0x0, + { "GDS Variable", "sna.gds", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_sna_gds_len, - { "GDS Variable Length", "sna.gds.len", FT_UINT16, BASE_DEC, + { "GDS Variable Length", "sna.gds.len", FT_UINT16, BASE_DEC, NULL, 0x7fff, NULL, HFILL }}, { &hf_sna_gds_cont, - { "Continuation Flag", "sna.gds.cont", FT_BOOLEAN, 16, NULL, + { "Continuation Flag", "sna.gds.cont", FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL }}, { &hf_sna_gds_type, - { "Type of Variable", "sna.gds.type", FT_UINT16, BASE_HEX, + { "Type of Variable", "sna.gds.type", FT_UINT16, BASE_HEX, VALS(sna_gds_var_vals), 0x0, NULL, HFILL }}, #if 0 { &hf_sna_xid, - { "XID", "sna.xid", FT_NONE, BASE_NONE, NULL, 0x0, + { "XID", "sna.xid", FT_NONE, BASE_NONE, NULL, 0x0, "XID Frame", HFILL }}, #endif { &hf_sna_xid_0, - { "XID Byte 0", "sna.xid.0", FT_UINT8, BASE_HEX, NULL, 0x0, + { "XID Byte 0", "sna.xid.0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_format, - { "XID Format", "sna.xid.format", FT_UINT8, BASE_DEC, NULL, + { "XID Format", "sna.xid.format", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }}, { &hf_sna_xid_type, - { "XID Type", "sna.xid.type", FT_UINT8, BASE_DEC, + { "XID Type", "sna.xid.type", FT_UINT8, BASE_DEC, VALS(sna_xid_type_vals), 0x0f, NULL, HFILL }}, { &hf_sna_xid_len, - { "XID Length", "sna.xid.len", FT_UINT8, BASE_DEC, NULL, 0x0, + { "XID Length", "sna.xid.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_id, - { "Node Identification", "sna.xid.id", FT_UINT32, BASE_HEX, + { "Node Identification", "sna.xid.id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_idblock, - { "ID Block", "sna.xid.idblock", FT_UINT32, BASE_HEX, NULL, + { "ID Block", "sna.xid.idblock", FT_UINT32, BASE_HEX, NULL, 0xfff00000, NULL, HFILL }}, { &hf_sna_xid_idnum, - { "ID Number", "sna.xid.idnum", FT_UINT32, BASE_HEX, NULL, + { "ID Number", "sna.xid.idnum", FT_UINT32, BASE_HEX, NULL, 0x0fffff, NULL, HFILL }}, { &hf_sna_xid_3_8, - { "Characteristics of XID sender", "sna.xid.type3.8", FT_UINT16, + { "Characteristics of XID sender", "sna.xid.type3.8", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_3_init_self, - { "INIT-SELF support", "sna.xid.type3.initself", + { "INIT-SELF support", "sna.xid.type3.initself", FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL }}, { &hf_sna_xid_3_stand_bind, - { "Stand-Alone BIND Support", "sna.xid.type3.stand_bind", + { "Stand-Alone BIND Support", "sna.xid.type3.stand_bind", FT_BOOLEAN, 16, NULL, 0x4000, NULL, HFILL }}, { &hf_sna_xid_3_gener_bind, - { "Whole BIND PIU generated indicator", + { "Whole BIND PIU generated indicator", "sna.xid.type3.gener_bind", FT_BOOLEAN, 16, NULL, 0x2000, "Whole BIND PIU generated", HFILL }}, { &hf_sna_xid_3_recve_bind, - { "Whole BIND PIU required indicator", + { "Whole BIND PIU required indicator", "sna.xid.type3.recve_bind", FT_BOOLEAN, 16, NULL, 0x1000, "Whole BIND PIU required", HFILL }}, { &hf_sna_xid_3_actpu, - { "ACTPU suppression indicator", "sna.xid.type3.actpu", + { "ACTPU suppression indicator", "sna.xid.type3.actpu", FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL }}, { &hf_sna_xid_3_nwnode, - { "Sender is network node", "sna.xid.type3.nwnode", + { "Sender is network node", "sna.xid.type3.nwnode", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL }}, { &hf_sna_xid_3_cp, - { "Control Point Services", "sna.xid.type3.cp", + { "Control Point Services", "sna.xid.type3.cp", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL }}, { &hf_sna_xid_3_cpcp, - { "CP-CP session support", "sna.xid.type3.cpcp", + { "CP-CP session support", "sna.xid.type3.cpcp", FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL }}, { &hf_sna_xid_3_state, - { "XID exchange state indicator", "sna.xid.type3.state", + { "XID exchange state indicator", "sna.xid.type3.state", FT_UINT16, BASE_HEX, VALS(sna_xid_3_state_vals), 0x000c, NULL, HFILL }}, { &hf_sna_xid_3_nonact, - { "Nonactivation Exchange", "sna.xid.type3.nonact", + { "Nonactivation Exchange", "sna.xid.type3.nonact", FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL }}, { &hf_sna_xid_3_cpchange, - { "CP name change support", "sna.xid.type3.cpchange", + { "CP name change support", "sna.xid.type3.cpchange", FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL }}, { &hf_sna_xid_3_10, - { "XID Type 3 Byte 10", "sna.xid.type3.10", FT_UINT8, BASE_HEX, + { "XID Type 3 Byte 10", "sna.xid.type3.10", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_3_asend_bind, - { "Adaptive BIND pacing support as sender", + { "Adaptive BIND pacing support as sender", "sna.xid.type3.asend_bind", FT_BOOLEAN, 8, NULL, 0x80, "Pacing support as sender", HFILL }}, { &hf_sna_xid_3_arecv_bind, - { "Adaptive BIND pacing support as receiver", + { "Adaptive BIND pacing support as receiver", "sna.xid.type3.asend_recv", FT_BOOLEAN, 8, NULL, 0x40, "Pacing support as receive", HFILL }}, { &hf_sna_xid_3_quiesce, - { "Quiesce TG Request", + { "Quiesce TG Request", "sna.xid.type3.quiesce", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_sna_xid_3_pucap, - { "PU Capabilities", + { "PU Capabilities", "sna.xid.type3.pucap", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_sna_xid_3_pbn, - { "Peripheral Border Node", + { "Peripheral Border Node", "sna.xid.type3.pbn", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_sna_xid_3_pacing, - { "Qualifier for adaptive BIND pacing support", + { "Qualifier for adaptive BIND pacing support", "sna.xid.type3.pacing", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL }}, { &hf_sna_xid_3_11, - { "XID Type 3 Byte 11", "sna.xid.type3.11", FT_UINT8, BASE_HEX, + { "XID Type 3 Byte 11", "sna.xid.type3.11", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_3_tgshare, - { "TG Sharing Prohibited Indicator", + { "TG Sharing Prohibited Indicator", "sna.xid.type3.tgshare", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_sna_xid_3_dedsvc, - { "Dedicated SVC Indicator", + { "Dedicated SVC Indicator", "sna.xid.type3.dedsvc", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_sna_xid_3_12, - { "XID Type 3 Byte 12", "sna.xid.type3.12", FT_UINT8, BASE_HEX, + { "XID Type 3 Byte 12", "sna.xid.type3.12", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_3_negcsup, - { "Negotiation Complete Supported", + { "Negotiation Complete Supported", "sna.xid.type3.negcsup", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_sna_xid_3_negcomp, - { "Negotiation Complete", + { "Negotiation Complete", "sna.xid.type3.negcomp", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_sna_xid_3_15, - { "XID Type 3 Byte 15", "sna.xid.type3.15", FT_UINT8, BASE_HEX, + { "XID Type 3 Byte 15", "sna.xid.type3.15", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_3_partg, - { "Parallel TG Support", + { "Parallel TG Support", "sna.xid.type3.partg", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_sna_xid_3_dlur, - { "Dependent LU Requester Indicator", + { "Dependent LU Requester Indicator", "sna.xid.type3.dlur", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_sna_xid_3_dlus, - { "DLUS Served LU Registration Indicator", + { "DLUS Served LU Registration Indicator", "sna.xid.type3.dlus", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_sna_xid_3_exbn, - { "Extended HPR Border Node", + { "Extended HPR Border Node", "sna.xid.type3.exbn", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_sna_xid_3_genodai, - { "Generalized ODAI Usage Option", + { "Generalized ODAI Usage Option", "sna.xid.type3.genodai", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_sna_xid_3_branch, - { "Branch Indicator", "sna.xid.type3.branch", + { "Branch Indicator", "sna.xid.type3.branch", FT_UINT8, BASE_HEX, VALS(sna_xid_3_branch_vals), 0x06, NULL, HFILL }}, { &hf_sna_xid_3_brnn, - { "Option Set 1123 Indicator", + { "Option Set 1123 Indicator", "sna.xid.type3.brnn", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_sna_xid_3_tg, - { "XID TG", "sna.xid.type3.tg", FT_UINT8, BASE_HEX, NULL, 0x0, + { "XID TG", "sna.xid.type3.tg", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_3_dlc, - { "XID DLC", "sna.xid.type3.dlc", FT_UINT8, BASE_HEX, NULL, 0x0, + { "XID DLC", "sna.xid.type3.dlc", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_sna_xid_3_dlen, - { "DLC Dependent Section Length", "sna.xid.type3.dlen", + { "DLC Dependent Section Length", "sna.xid.type3.dlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_control_len, - { "Control Vector Length", "sna.control.len", + { &hf_sna_control_len, + { "Control Vector Length", "sna.control.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_control_key, - { "Control Vector Key", "sna.control.key", + { &hf_sna_control_key, + { "Control Vector Key", "sna.control.key", FT_UINT8, BASE_HEX, VALS(sna_control_vals), 0x0, NULL, HFILL }}, - { &hf_sna_control_hprkey, - { "Control Vector HPR Key", "sna.control.hprkey", + { &hf_sna_control_hprkey, + { "Control Vector HPR Key", "sna.control.hprkey", FT_UINT8, BASE_HEX, VALS(sna_control_hpr_vals), 0x0, NULL, HFILL }}, - { &hf_sna_control_05_delay, - { "Channel Delay", "sna.control.05.delay", + { &hf_sna_control_05_delay, + { "Channel Delay", "sna.control.05.delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_control_05_type, - { "Network Address Type", "sna.control.05.type", + { &hf_sna_control_05_type, + { "Network Address Type", "sna.control.05.type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_sna_control_05_ptp, - { "Point-to-point", "sna.control.05.ptp", + { &hf_sna_control_05_ptp, + { "Point-to-point", "sna.control.05.ptp", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, - { &hf_sna_control_0e_type, - { "Type", "sna.control.0e.type", + { &hf_sna_control_0e_type, + { "Type", "sna.control.0e.type", FT_UINT8, BASE_HEX, VALS(sna_control_0e_type_vals), 0, NULL, HFILL }}, - { &hf_sna_control_0e_value, - { "Value", "sna.control.0e.value", + { &hf_sna_control_0e_value, + { "Value", "sna.control.0e.value", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, - { &hf_sna_padding, - { "Padding", "sna.padding", + { &hf_sna_padding, + { "Padding", "sna.padding", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, - { &hf_sna_reserved, - { "Reserved", "sna.reserved", + { &hf_sna_reserved, + { "Reserved", "sna.reserved", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, - }; + }; static gint *ett[] = { &ett_sna, &ett_sna_th, @@ -3549,3 +3549,16 @@ proto_reg_handoff_sna(void) data_handle = find_dissector("data"); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-synphasor.c b/epan/dissectors/packet-synphasor.c index 2713956cf7..835cbed00b 100644 --- a/epan/dissectors/packet-synphasor.c +++ b/epan/dissectors/packet-synphasor.c @@ -555,7 +555,7 @@ static int dissect_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v /*offset += 2;*/ /* CRC */ } /* if (tree) */ - return tvb_length(tvb); + return tvb_length(tvb); } /* dissect_synphasor() */ /* called for synchrophasors over UDP */ @@ -1348,3 +1348,16 @@ void proto_reg_handoff_synphasor(void) dissector_add_uint("tcp.port", current_tcp_port, synphasor_tcp_handle); dissector_add_uint("rtacser.data", RTACSER_PAYLOAD_SYNPHASOR, synphasor_udp_handle); } /* proto_reg_handoff_synphasor() */ + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c index 2d5c5c1104..86910a1b76 100644 --- a/epan/dissectors/packet-tacacs.c +++ b/epan/dissectors/packet-tacacs.c @@ -359,8 +359,8 @@ static gint ett_tacplus_flags = -1; static gint ett_tacplus_acct_flags = -1; typedef struct _tacplus_key_entry { - address *s; /* Server address */ - address *c; /* client address */ + address *s; /* Server address */ + address *c; /* client address */ char *k; /* Key */ } tacplus_key_entry; @@ -1309,3 +1309,16 @@ md5_xor( guint8 *data, const char *key, int data_len, guint8 *session_id, guint8 md5_finish(&mdcontext,hash); } } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c index ae93661a63..cb1a0b8953 100644 --- a/epan/dissectors/packet-tipc.c +++ b/epan/dissectors/packet-tipc.c @@ -3023,3 +3023,16 @@ proto_reg_handoff_tipc(void) tipc_udp_port_range = range_copy(global_tipc_udp_port_range); dissector_add_uint_range("udp.port", tipc_udp_port_range, tipc_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-tns.c b/epan/dissectors/packet-tns.c index 86c176bc9b..e1b3d188ee 100644 --- a/epan/dissectors/packet-tns.c +++ b/epan/dissectors/packet-tns.c @@ -750,10 +750,10 @@ static void dissect_tns_control(tvbuff_t *tvb, int offset, packet_info *pinfo, static guint get_tns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { - /* - * Get the length of the TNS message, including header - */ - return tvb_get_ntohs(tvb, offset); + /* + * Get the length of the TNS message, including header + */ + return tvb_get_ntohs(tvb, offset); } static int @@ -1239,3 +1239,16 @@ proto_reg_handoff_tns(void) dissector_add_uint("tcp.port", TCP_PORT_TNS, tns_handle); data_handle = find_dissector("data"); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-uma.c b/epan/dissectors/packet-uma.c index 0d842969f8..5b6e729f31 100644 --- a/epan/dissectors/packet-uma.c +++ b/epan/dissectors/packet-uma.c @@ -2307,3 +2307,16 @@ proto_register_uma(void) &global_uma_tcp_port_range, MAX_UDP_PORT); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-vines.c b/epan/dissectors/packet-vines.c index c4998dd198..2eda52decf 100644 --- a/epan/dissectors/packet-vines.c +++ b/epan/dissectors/packet-vines.c @@ -268,46 +268,46 @@ static gint ett_vines_icp = -1; /* VINES IP structs and definitions */ enum { - VIP_PROTO_IPC = 1, /* Interprocess Communications Protocol (IPC) */ - VIP_PROTO_SPP = 2, /* Sequenced Packet Protcol (SPP) */ - VIP_PROTO_ARP = 4, /* Address Resolution Protocol (ARP) */ - VIP_PROTO_RTP = 5, /* Routing Update Protocol (RTP) / SRTP (Sequenced RTP) */ - VIP_PROTO_ICP = 6 /* Internet Control Protocol (ICP) */ + VIP_PROTO_IPC = 1, /* Interprocess Communications Protocol (IPC) */ + VIP_PROTO_SPP = 2, /* Sequenced Packet Protcol (SPP) */ + VIP_PROTO_ARP = 4, /* Address Resolution Protocol (ARP) */ + VIP_PROTO_RTP = 5, /* Routing Update Protocol (RTP) / SRTP (Sequenced RTP) */ + VIP_PROTO_ICP = 6 /* Internet Control Protocol (ICP) */ }; /* VINES SPP and IPC structs and definitions */ enum { - PKTTYPE_DGRAM = 0, /* Unreliable datagram */ - PKTTYPE_DATA = 1, /* User Data */ - PKTTYPE_ERR = 2, /* Error */ - PKTTYPE_DISC = 3, /* Diconnect Request */ - PKTTYPE_PROBE = 4, /* Probe (retransmit) */ - PKTTYPE_ACK = 5 /* Acknowledgement */ + PKTTYPE_DGRAM = 0, /* Unreliable datagram */ + PKTTYPE_DATA = 1, /* User Data */ + PKTTYPE_ERR = 2, /* Error */ + PKTTYPE_DISC = 3, /* Diconnect Request */ + PKTTYPE_PROBE = 4, /* Probe (retransmit) */ + PKTTYPE_ACK = 5 /* Acknowledgement */ }; typedef struct _e_vspp { - guint16 vspp_sport; - guint16 vspp_dport; - guint8 vspp_pkttype; - guint8 vspp_control; - guint16 vspp_lclid; /* Local Connection ID */ - guint16 vspp_rmtid; /* Remote Connection ID */ - guint16 vspp_seqno; /* Sequence Number */ - guint16 vspp_ack; /* Acknowledgement Number */ - guint16 vspp_win; + guint16 vspp_sport; + guint16 vspp_dport; + guint8 vspp_pkttype; + guint8 vspp_control; + guint16 vspp_lclid; /* Local Connection ID */ + guint16 vspp_rmtid; /* Remote Connection ID */ + guint16 vspp_seqno; /* Sequence Number */ + guint16 vspp_ack; /* Acknowledgement Number */ + guint16 vspp_win; } e_vspp; typedef struct _e_vipc { - guint16 vipc_sport; - guint16 vipc_dport; - guint8 vipc_pkttype; - guint8 vipc_control; - guint16 vipc_lclid; /* Local Connection ID */ - guint16 vipc_rmtid; /* Remote Connection ID */ - guint16 vipc_seqno; /* Sequence Number */ - guint16 vipc_ack; /* Acknowledgement Number */ - guint16 vipc_err_len; + guint16 vipc_sport; + guint16 vipc_dport; + guint8 vipc_pkttype; + guint8 vipc_control; + guint16 vipc_lclid; /* Local Connection ID */ + guint16 vipc_rmtid; /* Remote Connection ID */ + guint16 vipc_seqno; /* Sequence Number */ + guint16 vipc_ack; /* Acknowledgement Number */ + guint16 vipc_err_len; } e_vipc; void @@ -358,7 +358,7 @@ dissect_vines_frp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static int dissect_vines_frp_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - void *params _U_) + void *params _U_) { if (pinfo->srcport != pinfo->destport) { /* Require that the source and destination ports be the @@ -801,7 +801,7 @@ dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *vipc_tree = NULL, *control_tree; proto_item *ti; tvbuff_t *next_tvb; - heur_dtbl_entry_t *hdtbl_entry; + heur_dtbl_entry_t *hdtbl_entry; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VIPC"); col_clear(pinfo->cinfo, COL_INFO); @@ -1014,7 +1014,7 @@ dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *vspp_tree, *control_tree; proto_item *ti; tvbuff_t *next_tvb; - heur_dtbl_entry_t *hdtbl_entry; + heur_dtbl_entry_t *hdtbl_entry; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VSPP"); col_clear(pinfo->cinfo, COL_INFO); @@ -1405,12 +1405,13 @@ srtp_show_machine_info(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_vines static int rtp_show_gateway_info(proto_tree *tree, tvbuff_t *tvb, int offset, - guint8 link_addr_length, guint8 source_route_length) + guint8 link_addr_length, guint8 source_route_length) { if (link_addr_length != 0) { - proto_tree_add_item(tree, - link_addr_length == 6 ? hf_vines_rtp_preferred_gateway_data_link_address_ether : hf_vines_rtp_preferred_gateway_data_link_address_bytes, - tvb, offset, link_addr_length, ENC_NA); + proto_tree_add_item( + tree, + link_addr_length == 6 ? hf_vines_rtp_preferred_gateway_data_link_address_ether : hf_vines_rtp_preferred_gateway_data_link_address_bytes, + tvb, offset, link_addr_length, ENC_NA); offset += link_addr_length; } if (source_route_length != 0) { @@ -2009,3 +2010,16 @@ proto_reg_handoff_vines_icp(void) proto_vines_icp); dissector_add_uint("vines_ip.protocol", VIP_PROTO_ICP, vines_icp_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-wlccp.c b/epan/dissectors/packet-wlccp.c index 19b134edbb..0e439f17c9 100644 --- a/epan/dissectors/packet-wlccp.c +++ b/epan/dissectors/packet-wlccp.c @@ -362,8 +362,8 @@ static const value_string wlccp_status_vs[] = { }; static const value_string cisco_pid_vals[] = { - { 0x0000, "WLCCP" }, - { 0, NULL } + { 0x0000, "WLCCP" }, + { 0, NULL } }; static const value_string wlccp_mode_vs[] = { @@ -4129,3 +4129,16 @@ proto_register_wlccp_oui(void) llc_add_oui(OUI_CISCOWL, "llc.wlccp_pid", "LLC Cisco WLCCP OUI PID", hf); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-wtls.c b/epan/dissectors/packet-wtls.c index 4e5dd3bcfd..4575603644 100644 --- a/epan/dissectors/packet-wtls.c +++ b/epan/dissectors/packet-wtls.c @@ -1592,3 +1592,16 @@ proto_reg_handoff_wtls(void) dissector_add_uint("udp.port", UDP_PORT_WTLS_WTP_WSP, wtls_handle); dissector_add_uint("udp.port", UDP_PORT_WTLS_WSP_PUSH,wtls_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c index 80157d9ebe..a0cfd92ee9 100644 --- a/epan/dissectors/packet-x25.c +++ b/epan/dissectors/packet-x25.c @@ -47,79 +47,79 @@ void proto_reg_handoff_x25(void); * Direction of packet. */ typedef enum { - X25_FROM_DCE, /* DCE->DTE */ - X25_FROM_DTE, /* DTE->DCE */ - X25_UNKNOWN /* direction unknown */ + X25_FROM_DCE, /* DCE->DTE */ + X25_FROM_DTE, /* DTE->DCE */ + X25_UNKNOWN /* direction unknown */ } x25_dir_t; /* * 0 for data packets, 1 for non-data packets. */ -#define X25_NONDATA_BIT 0x01 - -#define X25_CALL_REQUEST 0x0B -#define X25_CALL_ACCEPTED 0x0F -#define X25_CLEAR_REQUEST 0x13 -#define X25_CLEAR_CONFIRMATION 0x17 -#define X25_INTERRUPT 0x23 -#define X25_INTERRUPT_CONFIRMATION 0x27 -#define X25_RESET_REQUEST 0x1B -#define X25_RESET_CONFIRMATION 0x1F -#define X25_RESTART_REQUEST 0xFB -#define X25_RESTART_CONFIRMATION 0xFF -#define X25_REGISTRATION_REQUEST 0xF3 -#define X25_REGISTRATION_CONFIRMATION 0xF7 -#define X25_DIAGNOSTIC 0xF1 -#define X25_RR 0x01 -#define X25_RNR 0x05 -#define X25_REJ 0x09 -#define X25_DATA 0x00 - -#define PACKET_IS_DATA(type) (!(type & X25_NONDATA_BIT)) -#define PACKET_TYPE_FC(type) (type & 0x1F) - -#define X25_MBIT_MOD8 0x10 -#define X25_MBIT_MOD128 0x01 - -#define X25_ABIT 0x8000 - -#define X25_QBIT 0x8000 -#define X25_DBIT 0x4000 - -#define X25_FAC_CLASS_MASK 0xC0 - -#define X25_FAC_CLASS_A 0x00 -#define X25_FAC_CLASS_B 0x40 -#define X25_FAC_CLASS_C 0x80 -#define X25_FAC_CLASS_D 0xC0 - -#define X25_FAC_COMP_MARK 0x00 -#define X25_FAC_REVERSE 0x01 -#define X25_FAC_THROUGHPUT 0x02 -#define X25_FAC_CUG 0x03 -#define X25_FAC_CHARGING_INFO 0x04 -#define X25_FAC_CALLED_MODIF 0x08 -#define X25_FAC_CUG_OUTGOING_ACC 0x09 -#define X25_FAC_THROUGHPUT_MIN 0x0A -#define X25_FAC_EXPRESS_DATA 0x0B -#define X25_FAC_BILATERAL_CUG 0x41 -#define X25_FAC_PACKET_SIZE 0x42 -#define X25_FAC_WINDOW_SIZE 0x43 -#define X25_FAC_RPOA_SELECTION 0x44 -#define X25_FAC_CUG_EXT 0x47 -#define X25_FAC_CUG_OUTGOING_ACC_EXT 0x48 -#define X25_FAC_TRANSIT_DELAY 0x49 -#define X25_FAC_CALL_DURATION 0xC1 -#define X25_FAC_SEGMENT_COUNT 0xC2 -#define X25_FAC_CALL_TRANSFER 0xC3 -#define X25_FAC_RPOA_SELECTION_EXT 0xC4 -#define X25_FAC_MONETARY_UNIT 0xC5 -#define X25_FAC_NUI 0xC6 -#define X25_FAC_CALLED_ADDR_EXT 0xC9 -#define X25_FAC_ETE_TRANSIT_DELAY 0xCA -#define X25_FAC_CALLING_ADDR_EXT 0xCB -#define X25_FAC_CALL_DEFLECT 0xD1 -#define X25_FAC_PRIORITY 0xD2 +#define X25_NONDATA_BIT 0x01 + +#define X25_CALL_REQUEST 0x0B +#define X25_CALL_ACCEPTED 0x0F +#define X25_CLEAR_REQUEST 0x13 +#define X25_CLEAR_CONFIRMATION 0x17 +#define X25_INTERRUPT 0x23 +#define X25_INTERRUPT_CONFIRMATION 0x27 +#define X25_RESET_REQUEST 0x1B +#define X25_RESET_CONFIRMATION 0x1F +#define X25_RESTART_REQUEST 0xFB +#define X25_RESTART_CONFIRMATION 0xFF +#define X25_REGISTRATION_REQUEST 0xF3 +#define X25_REGISTRATION_CONFIRMATION 0xF7 +#define X25_DIAGNOSTIC 0xF1 +#define X25_RR 0x01 +#define X25_RNR 0x05 +#define X25_REJ 0x09 +#define X25_DATA 0x00 + +#define PACKET_IS_DATA(type) (!(type & X25_NONDATA_BIT)) +#define PACKET_TYPE_FC(type) (type & 0x1F) + +#define X25_MBIT_MOD8 0x10 +#define X25_MBIT_MOD128 0x01 + +#define X25_ABIT 0x8000 + +#define X25_QBIT 0x8000 +#define X25_DBIT 0x4000 + +#define X25_FAC_CLASS_MASK 0xC0 + +#define X25_FAC_CLASS_A 0x00 +#define X25_FAC_CLASS_B 0x40 +#define X25_FAC_CLASS_C 0x80 +#define X25_FAC_CLASS_D 0xC0 + +#define X25_FAC_COMP_MARK 0x00 +#define X25_FAC_REVERSE 0x01 +#define X25_FAC_THROUGHPUT 0x02 +#define X25_FAC_CUG 0x03 +#define X25_FAC_CHARGING_INFO 0x04 +#define X25_FAC_CALLED_MODIF 0x08 +#define X25_FAC_CUG_OUTGOING_ACC 0x09 +#define X25_FAC_THROUGHPUT_MIN 0x0A +#define X25_FAC_EXPRESS_DATA 0x0B +#define X25_FAC_BILATERAL_CUG 0x41 +#define X25_FAC_PACKET_SIZE 0x42 +#define X25_FAC_WINDOW_SIZE 0x43 +#define X25_FAC_RPOA_SELECTION 0x44 +#define X25_FAC_CUG_EXT 0x47 +#define X25_FAC_CUG_OUTGOING_ACC_EXT 0x48 +#define X25_FAC_TRANSIT_DELAY 0x49 +#define X25_FAC_CALL_DURATION 0xC1 +#define X25_FAC_SEGMENT_COUNT 0xC2 +#define X25_FAC_CALL_TRANSFER 0xC3 +#define X25_FAC_RPOA_SELECTION_EXT 0xC4 +#define X25_FAC_MONETARY_UNIT 0xC5 +#define X25_FAC_NUI 0xC6 +#define X25_FAC_CALLED_ADDR_EXT 0xC9 +#define X25_FAC_ETE_TRANSIT_DELAY 0xCA +#define X25_FAC_CALLING_ADDR_EXT 0xCB +#define X25_FAC_CALL_DEFLECT 0xD1 +#define X25_FAC_PRIORITY 0xD2 static int proto_x25 = -1; static int hf_x25_facility = -1; @@ -225,285 +225,285 @@ static gint hf_x25_reg_confirm_diagnostic = -1; static expert_field ei_x25_facility_length = EI_INIT; static const value_string vals_modulo[] = { - { 1, "8" }, - { 2, "128" }, - { 0, NULL} + { 1, "8" }, + { 2, "128" }, + { 0, NULL} }; static const value_string vals_x25_type[] = { - { X25_CALL_REQUEST, "Call" }, - { X25_CALL_ACCEPTED, "Call Accepted" }, - { X25_CLEAR_REQUEST, "Clear" }, - { X25_CLEAR_CONFIRMATION, "Clear Confirmation" }, - { X25_INTERRUPT, "Interrupt" }, - { X25_INTERRUPT_CONFIRMATION, "Interrupt Confirmation" }, - { X25_RESET_REQUEST, "Reset" }, - { X25_RESET_CONFIRMATION, "Reset Confirmation" }, - { X25_RESTART_REQUEST, "Restart" }, - { X25_RESTART_CONFIRMATION, "Restart Confirmation" }, - { X25_REGISTRATION_REQUEST, "Registration" }, - { X25_REGISTRATION_CONFIRMATION, "Registration Confirmation" }, - { X25_DIAGNOSTIC, "Diagnostic" }, - { X25_RR, "RR" }, - { X25_RNR, "RNR" }, - { X25_REJ, "REJ" }, - { X25_DATA, "Data" }, - { 0, NULL} + { X25_CALL_REQUEST, "Call" }, + { X25_CALL_ACCEPTED, "Call Accepted" }, + { X25_CLEAR_REQUEST, "Clear" }, + { X25_CLEAR_CONFIRMATION, "Clear Confirmation" }, + { X25_INTERRUPT, "Interrupt" }, + { X25_INTERRUPT_CONFIRMATION, "Interrupt Confirmation" }, + { X25_RESET_REQUEST, "Reset" }, + { X25_RESET_CONFIRMATION, "Reset Confirmation" }, + { X25_RESTART_REQUEST, "Restart" }, + { X25_RESTART_CONFIRMATION, "Restart Confirmation" }, + { X25_REGISTRATION_REQUEST, "Registration" }, + { X25_REGISTRATION_CONFIRMATION, "Registration Confirmation" }, + { X25_DIAGNOSTIC, "Diagnostic" }, + { X25_RR, "RR" }, + { X25_RNR, "RNR" }, + { X25_REJ, "REJ" }, + { X25_DATA, "Data" }, + { 0, NULL} }; static struct true_false_string m_bit_tfs = { - "More data follows", - "End of data" + "More data follows", + "End of data" }; static const value_string x25_fast_select_vals[] = { - { 0, "Not requested" }, - { 1, "Not requested" }, - { 2, "No restriction on response" }, - { 3, "Restriction on response" }, - { 0, NULL} + { 0, "Not requested" }, + { 1, "Not requested" }, + { 2, "No restriction on response" }, + { 3, "Restriction on response" }, + { 0, NULL} }; static const value_string x25_icrd_vals[] = { - { 0, "Status not selected" }, - { 1, "Prevention requested" }, - { 2, "Allowance requested" }, - { 3, "Not allowed" }, - { 0, NULL} + { 0, "Status not selected" }, + { 1, "Prevention requested" }, + { 2, "Allowance requested" }, + { 3, "Not allowed" }, + { 0, NULL} }; static const value_string x25_clear_diag_vals[] = { - { 0, "No additional information" }, - { 1, "Invalid P(S)" }, - { 2, "Invalid P(R)" }, - { 16, "Packet type invalid" }, - { 17, "Packet type invalid for state r1" }, - { 18, "Packet type invalid for state r2" }, - { 19, "Packet type invalid for state r3" }, - { 20, "Packet type invalid for state p1" }, - { 21, "Packet type invalid for state p2" }, - { 22, "Packet type invalid for state p3" }, - { 23, "Packet type invalid for state p4" }, - { 24, "Packet type invalid for state p5" }, - { 25, "Packet type invalid for state p6" }, - { 26, "Packet type invalid for state p7" }, - { 27, "Packet type invalid for state d1" }, - { 28, "Packet type invalid for state d2" }, - { 29, "Packet type invalid for state d3" }, - { 32, "Packet not allowed" }, - { 33, "Unidentifiable packet" }, - { 34, "Call on one-way logical channel" }, - { 35, "Invalid packet type on a PVC" }, - { 36, "Packet on unassigned LC" }, - { 37, "Reject not subscribed to" }, - { 38, "Packet too short" }, - { 39, "Packet too long" }, - { 40, "Invalid general format identifier" }, - { 41, "Restart/registration packet with nonzero bits" }, - { 42, "Packet type not compatible with facility" }, - { 43, "Unauthorised interrupt confirmation" }, - { 44, "Unauthorised interrupt" }, - { 45, "Unauthorised reject" }, - { 48, "Time expired" }, - { 49, "Time expired for incoming call" }, - { 50, "Time expired for clear indication" }, - { 51, "Time expired for reset indication" }, - { 52, "Time expired for restart indication" }, - { 53, "Time expired for call deflection" }, - { 64, "Call set-up/clearing or registration pb." }, - { 65, "Facility/registration code not allowed" }, - { 66, "Facility parameter not allowed" }, - { 67, "Invalid called DTE address" }, - { 68, "Invalid calling DTE address" }, - { 69, "Invalid facility/registration length" }, - { 70, "Incoming call barred" }, - { 71, "No logical channel available" }, - { 72, "Call collision" }, - { 73, "Duplicate facility requested" }, - { 74, "Non zero address length" }, - { 75, "Non zero facility length" }, - { 76, "Facility not provided when expected" }, - { 77, "Invalid CCITT-specified DTE facility" }, - { 78, "Max. nb of call redir/defl. exceeded" }, - { 80, "Miscellaneous" }, - { 81, "Improper cause code from DTE" }, - { 82, "Not aligned octet" }, - { 83, "Inconsistent Q bit setting" }, - { 84, "NUI problem" }, - { 112, "International problem" }, - { 113, "Remote network problem" }, - { 114, "International protocol problem" }, - { 115, "International link out of order" }, - { 116, "International link busy" }, - { 117, "Transit network facility problem" }, - { 118, "Remote network facility problem" }, - { 119, "International routing problem" }, - { 120, "Temporary routing problem" }, - { 121, "Unknown called DNIC" }, - { 122, "Maintenance action" }, - { 144, "Timer expired or retransmission count surpassed" }, - { 145, "Timer expired or retransmission count surpassed for INTERRUPT" }, - { 146, "Timer expired or retransmission count surpassed for DATA packet transmission" }, - { 147, "Timer expired or retransmission count surpassed for REJECT" }, - { 160, "DTE-specific signals" }, - { 161, "DTE operational" }, - { 162, "DTE not operational" }, - { 163, "DTE resource constraint" }, - { 164, "Fast select not subscribed" }, - { 165, "Invalid partially full DATA packet" }, - { 166, "D-bit procedure not supported" }, - { 167, "Registration/Cancellation confirmed" }, - { 224, "OSI network service problem" }, - { 225, "Disconnection (transient condition)" }, - { 226, "Disconnection (permanent condition)" }, - { 227, "Connection rejection - reason unspecified (transient condition)" }, - { 228, "Connection rejection - reason unspecified (permanent condition)" }, - { 229, "Connection rejection - quality of service not available (transient condition)" }, - { 230, "Connection rejection - quality of service not available (permanent condition)" }, - { 231, "Connection rejection - NSAP unreachable (transient condition)" }, - { 232, "Connection rejection - NSAP unreachable (permanent condition)" }, - { 233, "reset - reason unspecified" }, - { 234, "reset - congestion" }, - { 235, "Connection rejection - NSAP address unknown (permanent condition)" }, - { 240, "Higher layer initiated" }, - { 241, "Disconnection - normal" }, - { 242, "Disconnection - abnormal" }, - { 243, "Disconnection - incompatible information in user data" }, - { 244, "Connection rejection - reason unspecified (transient condition)" }, - { 245, "Connection rejection - reason unspecified (permanent condition)" }, - { 246, "Connection rejection - quality of service not available (transient condition)" }, - { 247, "Connection rejection - quality of service not available (permanent condition)" }, - { 248, "Connection rejection - incompatible information in user data" }, - { 249, "Connection rejection - unrecognizable protocol identifier in user data" }, - { 250, "Reset - user resynchronization" }, - { 0, NULL} + { 0, "No additional information" }, + { 1, "Invalid P(S)" }, + { 2, "Invalid P(R)" }, + { 16, "Packet type invalid" }, + { 17, "Packet type invalid for state r1" }, + { 18, "Packet type invalid for state r2" }, + { 19, "Packet type invalid for state r3" }, + { 20, "Packet type invalid for state p1" }, + { 21, "Packet type invalid for state p2" }, + { 22, "Packet type invalid for state p3" }, + { 23, "Packet type invalid for state p4" }, + { 24, "Packet type invalid for state p5" }, + { 25, "Packet type invalid for state p6" }, + { 26, "Packet type invalid for state p7" }, + { 27, "Packet type invalid for state d1" }, + { 28, "Packet type invalid for state d2" }, + { 29, "Packet type invalid for state d3" }, + { 32, "Packet not allowed" }, + { 33, "Unidentifiable packet" }, + { 34, "Call on one-way logical channel" }, + { 35, "Invalid packet type on a PVC" }, + { 36, "Packet on unassigned LC" }, + { 37, "Reject not subscribed to" }, + { 38, "Packet too short" }, + { 39, "Packet too long" }, + { 40, "Invalid general format identifier" }, + { 41, "Restart/registration packet with nonzero bits" }, + { 42, "Packet type not compatible with facility" }, + { 43, "Unauthorised interrupt confirmation" }, + { 44, "Unauthorised interrupt" }, + { 45, "Unauthorised reject" }, + { 48, "Time expired" }, + { 49, "Time expired for incoming call" }, + { 50, "Time expired for clear indication" }, + { 51, "Time expired for reset indication" }, + { 52, "Time expired for restart indication" }, + { 53, "Time expired for call deflection" }, + { 64, "Call set-up/clearing or registration pb." }, + { 65, "Facility/registration code not allowed" }, + { 66, "Facility parameter not allowed" }, + { 67, "Invalid called DTE address" }, + { 68, "Invalid calling DTE address" }, + { 69, "Invalid facility/registration length" }, + { 70, "Incoming call barred" }, + { 71, "No logical channel available" }, + { 72, "Call collision" }, + { 73, "Duplicate facility requested" }, + { 74, "Non zero address length" }, + { 75, "Non zero facility length" }, + { 76, "Facility not provided when expected" }, + { 77, "Invalid CCITT-specified DTE facility" }, + { 78, "Max. nb of call redir/defl. exceeded" }, + { 80, "Miscellaneous" }, + { 81, "Improper cause code from DTE" }, + { 82, "Not aligned octet" }, + { 83, "Inconsistent Q bit setting" }, + { 84, "NUI problem" }, + { 112, "International problem" }, + { 113, "Remote network problem" }, + { 114, "International protocol problem" }, + { 115, "International link out of order" }, + { 116, "International link busy" }, + { 117, "Transit network facility problem" }, + { 118, "Remote network facility problem" }, + { 119, "International routing problem" }, + { 120, "Temporary routing problem" }, + { 121, "Unknown called DNIC" }, + { 122, "Maintenance action" }, + { 144, "Timer expired or retransmission count surpassed" }, + { 145, "Timer expired or retransmission count surpassed for INTERRUPT" }, + { 146, "Timer expired or retransmission count surpassed for DATA packet transmission" }, + { 147, "Timer expired or retransmission count surpassed for REJECT" }, + { 160, "DTE-specific signals" }, + { 161, "DTE operational" }, + { 162, "DTE not operational" }, + { 163, "DTE resource constraint" }, + { 164, "Fast select not subscribed" }, + { 165, "Invalid partially full DATA packet" }, + { 166, "D-bit procedure not supported" }, + { 167, "Registration/Cancellation confirmed" }, + { 224, "OSI network service problem" }, + { 225, "Disconnection (transient condition)" }, + { 226, "Disconnection (permanent condition)" }, + { 227, "Connection rejection - reason unspecified (transient condition)" }, + { 228, "Connection rejection - reason unspecified (permanent condition)" }, + { 229, "Connection rejection - quality of service not available (transient condition)" }, + { 230, "Connection rejection - quality of service not available (permanent condition)" }, + { 231, "Connection rejection - NSAP unreachable (transient condition)" }, + { 232, "Connection rejection - NSAP unreachable (permanent condition)" }, + { 233, "reset - reason unspecified" }, + { 234, "reset - congestion" }, + { 235, "Connection rejection - NSAP address unknown (permanent condition)" }, + { 240, "Higher layer initiated" }, + { 241, "Disconnection - normal" }, + { 242, "Disconnection - abnormal" }, + { 243, "Disconnection - incompatible information in user data" }, + { 244, "Connection rejection - reason unspecified (transient condition)" }, + { 245, "Connection rejection - reason unspecified (permanent condition)" }, + { 246, "Connection rejection - quality of service not available (transient condition)" }, + { 247, "Connection rejection - quality of service not available (permanent condition)" }, + { 248, "Connection rejection - incompatible information in user data" }, + { 249, "Connection rejection - unrecognizable protocol identifier in user data" }, + { 250, "Reset - user resynchronization" }, + { 0, NULL} }; value_string_ext x25_clear_diag_vals_ext = VALUE_STRING_EXT_INIT(x25_clear_diag_vals); static const value_string x25_registration_code_vals[] = { - { 0x03, "Invalid facility request" }, - { 0x05, "Network congestion" }, - { 0x13, "Local procedure error" }, - { 0x7F, "Registration/cancellation confirmed" }, - { 0, NULL} + { 0x03, "Invalid facility request" }, + { 0x05, "Network congestion" }, + { 0x13, "Local procedure error" }, + { 0x7F, "Registration/cancellation confirmed" }, + { 0, NULL} }; static const value_string x25_facilities_class_vals[] = { - { X25_FAC_CLASS_A>>6, "A" }, - { X25_FAC_CLASS_B>>6, "B" }, - { X25_FAC_CLASS_C>>6, "C" }, - { X25_FAC_CLASS_D>>6, "D" }, - { 0, NULL} + { X25_FAC_CLASS_A>>6, "A" }, + { X25_FAC_CLASS_B>>6, "B" }, + { X25_FAC_CLASS_C>>6, "C" }, + { X25_FAC_CLASS_D>>6, "D" }, + { 0, NULL} }; static const value_string x25_facilities_classA_vals[] = { - { X25_FAC_COMP_MARK, "Marker" }, - { X25_FAC_REVERSE, "Reverse charging / Fast select" }, - { X25_FAC_CHARGING_INFO, "Charging information" }, - { X25_FAC_THROUGHPUT, "Throughput class negotiation" }, - { X25_FAC_CUG, "Closed user group selection" }, - { X25_FAC_CALLED_MODIF, "Called address modified" }, - { X25_FAC_CUG_OUTGOING_ACC, "Closed user group with outgoing access selection" }, - { X25_FAC_THROUGHPUT_MIN, "Minimum throughput class" }, - { X25_FAC_EXPRESS_DATA, "Negotiation of express data" }, - { 0, NULL} + { X25_FAC_COMP_MARK, "Marker" }, + { X25_FAC_REVERSE, "Reverse charging / Fast select" }, + { X25_FAC_CHARGING_INFO, "Charging information" }, + { X25_FAC_THROUGHPUT, "Throughput class negotiation" }, + { X25_FAC_CUG, "Closed user group selection" }, + { X25_FAC_CALLED_MODIF, "Called address modified" }, + { X25_FAC_CUG_OUTGOING_ACC, "Closed user group with outgoing access selection" }, + { X25_FAC_THROUGHPUT_MIN, "Minimum throughput class" }, + { X25_FAC_EXPRESS_DATA, "Negotiation of express data" }, + { 0, NULL} }; static const value_string x25_facilities_classA_comp_mark_vals[] = { - { 0x00, "Network complementary services - calling DTE" }, - { 0x0F, "DTE complementary services" }, - { 0xFF, "Network complementary services - called DTE" }, - { 0, NULL} + { 0x00, "Network complementary services - calling DTE" }, + { 0x0F, "DTE complementary services" }, + { 0xFF, "Network complementary services - called DTE" }, + { 0, NULL} }; static const value_string x25_facilities_classA_throughput_vals[] = { - { 3, "75 bps" }, - { 4, "150 bps" }, - { 5, "300 bps" }, - { 6, "600 bps" }, - { 7, "1200 bps" }, - { 8, "2400 bps" }, - { 9, "4800 bps" }, - { 10, "9600 bps" }, - { 11, "19200 bps" }, - { 12, "48000 bps" }, - { 13, "64000 bps" }, - { 0, NULL} + { 3, "75 bps" }, + { 4, "150 bps" }, + { 5, "300 bps" }, + { 6, "600 bps" }, + { 7, "1200 bps" }, + { 8, "2400 bps" }, + { 9, "4800 bps" }, + { 10, "9600 bps" }, + { 11, "19200 bps" }, + { 12, "48000 bps" }, + { 13, "64000 bps" }, + { 0, NULL} }; static const value_string x25_facilities_classB_vals[] = { - { X25_FAC_BILATERAL_CUG, "Bilateral closed user group selection" }, - { X25_FAC_PACKET_SIZE, "Packet size" }, - { X25_FAC_WINDOW_SIZE, "Window size" }, - { X25_FAC_RPOA_SELECTION, "RPOA selection" }, - { X25_FAC_CUG_EXT, "Extended closed user group selection" }, - { X25_FAC_CUG_OUTGOING_ACC_EXT, "Extended closed user group with outgoing access selection" }, - { X25_FAC_TRANSIT_DELAY, "Transit delay selection and indication" }, - { 0, NULL} + { X25_FAC_BILATERAL_CUG, "Bilateral closed user group selection" }, + { X25_FAC_PACKET_SIZE, "Packet size" }, + { X25_FAC_WINDOW_SIZE, "Window size" }, + { X25_FAC_RPOA_SELECTION, "RPOA selection" }, + { X25_FAC_CUG_EXT, "Extended closed user group selection" }, + { X25_FAC_CUG_OUTGOING_ACC_EXT, "Extended closed user group with outgoing access selection" }, + { X25_FAC_TRANSIT_DELAY, "Transit delay selection and indication" }, + { 0, NULL} }; static const value_string x25_facilities_classB_packet_size_vals[] = { - { 0x04, "16" }, - { 0x05, "32" }, - { 0x06, "64" }, - { 0x07, "128" }, - { 0x08, "256" }, - { 0x09, "512" }, - { 0x0A, "1024" }, - { 0x0B, "2048" }, - { 0x0C, "4096" }, - { 0, NULL} + { 0x04, "16" }, + { 0x05, "32" }, + { 0x06, "64" }, + { 0x07, "128" }, + { 0x08, "256" }, + { 0x09, "512" }, + { 0x0A, "1024" }, + { 0x0B, "2048" }, + { 0x0C, "4096" }, + { 0, NULL} }; static const value_string x25_facilities_classC_vals[] = { - { 0, NULL} + { 0, NULL} }; static const value_string x25_facilities_classD_vals[] = { - { X25_FAC_CALL_DURATION, "Call duration" }, - { X25_FAC_SEGMENT_COUNT, "Segment count" }, - { X25_FAC_CALL_TRANSFER, "Call redirection or deflection notification" }, - { X25_FAC_RPOA_SELECTION_EXT, "Extended RPOA selection" }, - { X25_FAC_CALLING_ADDR_EXT, "Calling address extension" }, - { X25_FAC_MONETARY_UNIT, "Monetary Unit" }, - { X25_FAC_NUI, "Network User Identification selection" }, - { X25_FAC_CALLED_ADDR_EXT, "Called address extension" }, - { X25_FAC_ETE_TRANSIT_DELAY, "End to end transit delay" }, - { X25_FAC_CALL_DEFLECT, "Call deflection selection" }, - { X25_FAC_PRIORITY, "Priority" }, - { 0, NULL} + { X25_FAC_CALL_DURATION, "Call duration" }, + { X25_FAC_SEGMENT_COUNT, "Segment count" }, + { X25_FAC_CALL_TRANSFER, "Call redirection or deflection notification" }, + { X25_FAC_RPOA_SELECTION_EXT, "Extended RPOA selection" }, + { X25_FAC_CALLING_ADDR_EXT, "Calling address extension" }, + { X25_FAC_MONETARY_UNIT, "Monetary Unit" }, + { X25_FAC_NUI, "Network User Identification selection" }, + { X25_FAC_CALLED_ADDR_EXT, "Called address extension" }, + { X25_FAC_ETE_TRANSIT_DELAY, "End to end transit delay" }, + { X25_FAC_CALL_DEFLECT, "Call deflection selection" }, + { X25_FAC_PRIORITY, "Priority" }, + { 0, NULL} }; static struct true_false_string x25_reverse_charging_val = { - "Requested", - "Not requested" + "Requested", + "Not requested" }; static const value_string x25_facilities_call_transfer_reason_vals[] = { - { 0x01, "originally called DTE busy" }, - { 0x07, "call dist. within a hunt group" }, - { 0x09, "originally called DTE out of order" }, - { 0x0F, "systematic call redirection" }, - { 0, NULL} + { 0x01, "originally called DTE busy" }, + { 0x07, "call dist. within a hunt group" }, + { 0x09, "originally called DTE out of order" }, + { 0x0F, "systematic call redirection" }, + { 0, NULL} }; static const fragment_items x25_frag_items = { - &ett_x25_segment, - &ett_x25_segments, - &hf_x25_segments, - &hf_x25_segment, - &hf_x25_segment_overlap, - &hf_x25_segment_overlap_conflict, - &hf_x25_segment_multiple_tails, - &hf_x25_segment_too_long_segment, - &hf_x25_segment_error, - &hf_x25_segment_count, - NULL, - &hf_x25_reassembled_length, - /* Reassembled data field */ - NULL, - "segments" + &ett_x25_segment, + &ett_x25_segments, + &hf_x25_segments, + &hf_x25_segment, + &hf_x25_segment_overlap, + &hf_x25_segment_overlap_conflict, + &hf_x25_segment_multiple_tails, + &hf_x25_segment_too_long_segment, + &hf_x25_segment_error, + &hf_x25_segment_count, + NULL, + &hf_x25_reassembled_length, + /* Reassembled data field */ + NULL, + "segments" }; static dissector_handle_t ip_handle; @@ -528,491 +528,491 @@ static heur_dissector_list_t x25_heur_subdissector_list; static void x25_hash_add_proto_start(guint16 vc, guint32 frame, dissector_handle_t dissect) { - circuit_t *circuit; + circuit_t *circuit; - /* - * Is there already a circuit with this VC number? - */ - circuit = find_circuit(CT_X25, vc, frame); - if (circuit != NULL) { /* - * Yes - close it, as we're creating a new one. + * Is there already a circuit with this VC number? */ - close_circuit(circuit, frame - 1); - } - - /* - * Set up a new circuit. - */ - circuit = circuit_new(CT_X25, vc, frame); - - /* - * Set its dissector. - */ - circuit_set_dissector(circuit, dissect); + circuit = find_circuit(CT_X25, vc, frame); + if (circuit != NULL) { + /* + * Yes - close it, as we're creating a new one. + */ + close_circuit(circuit, frame - 1); + } + + /* + * Set up a new circuit. + */ + circuit = circuit_new(CT_X25, vc, frame); + + /* + * Set its dissector. + */ + circuit_set_dissector(circuit, dissect); } static void x25_hash_add_proto_end(guint16 vc, guint32 frame) { - circuit_t *circuit; - - /* - * Try to find the circuit. - */ - circuit = find_circuit(CT_X25, vc, frame); - - /* - * If we succeeded, close it. - */ - if (circuit != NULL) - close_circuit(circuit, frame); + circuit_t *circuit; + + /* + * Try to find the circuit. + */ + circuit = find_circuit(CT_X25, vc, frame); + + /* + * If we succeeded, close it. + */ + if (circuit != NULL) + close_circuit(circuit, frame); } static const char *clear_code(unsigned char code) { - if (code == 0x00 || (code & 0x80) == 0x80) - return "DTE Originated"; - - switch(code) - { - case 0x01: - return "Number Busy"; - case 0x03: - return "Invalid Facility Requested"; - case 0x05: - return "Network Congestion"; - case 0x09: - return "Out Of Order"; - case 0x0B: - return "Access Barred"; - case 0x0D: - return "Not Obtainable"; - case 0x11: - return "Remote Procedure Error"; - case 0x13: - return "Local Procedure Error"; - case 0x15: - return "RPOA Out Of Order"; - case 0x19: - return "Reverse Charging Acceptance Not Subscribed"; - case 0x21: - return "Incompatible Destination"; - case 0x29: - return "Fast Select Acceptance Not Subscribed"; - case 0x39: - return "Destination Absent"; - } - - return wmem_strdup_printf(wmem_packet_scope(),"Unknown %02X", code); + if (code == 0x00 || (code & 0x80) == 0x80) + return "DTE Originated"; + + switch(code) + { + case 0x01: + return "Number Busy"; + case 0x03: + return "Invalid Facility Requested"; + case 0x05: + return "Network Congestion"; + case 0x09: + return "Out Of Order"; + case 0x0B: + return "Access Barred"; + case 0x0D: + return "Not Obtainable"; + case 0x11: + return "Remote Procedure Error"; + case 0x13: + return "Local Procedure Error"; + case 0x15: + return "RPOA Out Of Order"; + case 0x19: + return "Reverse Charging Acceptance Not Subscribed"; + case 0x21: + return "Incompatible Destination"; + case 0x29: + return "Fast Select Acceptance Not Subscribed"; + case 0x39: + return "Destination Absent"; + } + + return wmem_strdup_printf(wmem_packet_scope(),"Unknown %02X", code); } static const char *reset_code(unsigned char code) { - if (code == 0x00 || (code & 0x80) == 0x80) - return "DTE Originated"; - - switch(code) - { - case 0x01: - return "Out of order"; - case 0x03: - return "Remote Procedure Error"; - case 0x05: - return "Local Procedure Error"; - case 0x07: - return "Network Congestion"; - case 0x09: - return "Remote DTE operational"; - case 0x0F: - return "Network operational"; - case 0x11: - return "Incompatible Destination"; - case 0x1D: - return "Network out of order"; - } - - return wmem_strdup_printf(wmem_packet_scope(),"Unknown %02X", code); + if (code == 0x00 || (code & 0x80) == 0x80) + return "DTE Originated"; + + switch(code) + { + case 0x01: + return "Out of order"; + case 0x03: + return "Remote Procedure Error"; + case 0x05: + return "Local Procedure Error"; + case 0x07: + return "Network Congestion"; + case 0x09: + return "Remote DTE operational"; + case 0x0F: + return "Network operational"; + case 0x11: + return "Incompatible Destination"; + case 0x1D: + return "Network out of order"; + } + + return wmem_strdup_printf(wmem_packet_scope(),"Unknown %02X", code); } static const char *restart_code(unsigned char code) { - if (code == 0x00 || (code & 0x80) == 0x80) - return "DTE Originated"; - - switch(code) - { - case 0x01: - return "Local Procedure Error"; - case 0x03: - return "Network Congestion"; - case 0x07: - return "Network Operational"; - case 0x7F: - return "Registration/cancellation confirmed"; - } - - return wmem_strdup_printf(wmem_packet_scope(),"Unknown %02X", code); + if (code == 0x00 || (code & 0x80) == 0x80) + return "DTE Originated"; + + switch(code) + { + case 0x01: + return "Local Procedure Error"; + case 0x03: + return "Network Congestion"; + case 0x07: + return "Network Operational"; + case 0x7F: + return "Registration/cancellation confirmed"; + } + + return wmem_strdup_printf(wmem_packet_scope(),"Unknown %02X", code); } static char * dte_address_util(tvbuff_t *tvb, int offset, guint8 len) { - int i; - char *tmpbuf = (char *)wmem_alloc(wmem_packet_scope(), 258); - - for (i = 0; (i<len)&&(i<256); i++) { - if (i % 2 == 0) { - tmpbuf[i] = ((tvb_get_guint8(tvb, offset+i/2) >> 4) & 0x0F) + '0'; - /* if > 9, convert to the right hexadecimal letter */ - if (tmpbuf[i] > '9') - tmpbuf[i] += ('A' - '0' - 10); - } else { - tmpbuf[i] = (tvb_get_guint8(tvb, offset+i/2) & 0x0F) + '0'; - /* if > 9, convert to the right hexadecimal letter */ - if (tmpbuf[i] > '9') - tmpbuf[i] += ('A' - '0' - 10); - } - } - - tmpbuf[i] = '\0'; - - return tmpbuf; + int i; + char *tmpbuf = (char *)wmem_alloc(wmem_packet_scope(), 258); + + for (i = 0; (i<len)&&(i<256); i++) { + if (i % 2 == 0) { + tmpbuf[i] = ((tvb_get_guint8(tvb, offset+i/2) >> 4) & 0x0F) + '0'; + /* if > 9, convert to the right hexadecimal letter */ + if (tmpbuf[i] > '9') + tmpbuf[i] += ('A' - '0' - 10); + } else { + tmpbuf[i] = (tvb_get_guint8(tvb, offset+i/2) & 0x0F) + '0'; + /* if > 9, convert to the right hexadecimal letter */ + if (tmpbuf[i] > '9') + tmpbuf[i] += ('A' - '0' - 10); + } + } + + tmpbuf[i] = '\0'; + + return tmpbuf; } static void add_priority(proto_tree *tree, int hf, tvbuff_t *tvb, int offset) { - guint8 priority; - - priority = tvb_get_guint8(tvb, offset); - if (priority == 255) - proto_tree_add_uint_format_value(tree, hf, tvb, offset, 1, priority, - "Unspecified (255)"); - else - proto_tree_add_uint(tree, hf, tvb, offset, 1, priority); + guint8 priority; + + priority = tvb_get_guint8(tvb, offset); + if (priority == 255) + proto_tree_add_uint_format_value(tree, hf, tvb, offset, 1, priority, + "Unspecified (255)"); + else + proto_tree_add_uint(tree, hf, tvb, offset, 1, priority); } static void dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb, packet_info *pinfo) { - guint8 fac, byte1, byte2, byte3; - guint32 len; /* facilities length */ - proto_item *ti = NULL; - proto_tree *facilities_tree = NULL, *facility_tree = NULL; - - len = tvb_get_guint8(tvb, *offset); - if (len && tree) { - facilities_tree = proto_tree_add_subtree(tree, tvb, *offset, len + 1, - ett_x25_facilities, NULL, "Facilities"); - proto_tree_add_item(facilities_tree, hf_x25_facilities_length, tvb, *offset, 1, ENC_NA); - } - (*offset)++; - - while (len > 0) { - ti = proto_tree_add_item(facilities_tree, hf_x25_facility, tvb, *offset, -1, ENC_NA); - fac = tvb_get_guint8(tvb, *offset); - switch(fac & X25_FAC_CLASS_MASK) { - case X25_FAC_CLASS_A: - proto_item_set_len(ti, 2); - proto_item_append_text(ti, ": %s", - val_to_str(fac, x25_facilities_classA_vals, "Unknown (0x%02X)")); - facility_tree = proto_item_add_subtree(ti, ett_x25_facility); - proto_tree_add_item(facility_tree, hf_x25_facility_class, tvb, *offset, 1, ENC_NA); - proto_tree_add_item(facility_tree, hf_x25_facility_classA, tvb, *offset, 1, ENC_NA); - if (facility_tree) { - switch (fac) { - case X25_FAC_COMP_MARK: - proto_tree_add_item(facility_tree, hf_x25_facility_classA_comp_mark, tvb, *offset+1, 1, ENC_NA); - break; - case X25_FAC_REVERSE: - proto_tree_add_item(facility_tree, hf_x25_facility_classA_reverse, tvb, *offset+1, 1, ENC_NA); - proto_tree_add_item(facility_tree, hf_x25_fast_select, tvb, *offset+1, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(facility_tree, hf_x25_icrd, tvb, *offset+1, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(facility_tree, hf_x25_facility_reverse_charging, tvb, *offset+1, 1, ENC_BIG_ENDIAN); - break; - case X25_FAC_CHARGING_INFO: - proto_tree_add_item(facility_tree, hf_x25_facility_classA_charging_info, tvb, *offset+1, 1, ENC_NA); - proto_tree_add_item(facility_tree, hf_x25_facility_charging_info, tvb, *offset+1, 1, ENC_NA); - break; - case X25_FAC_THROUGHPUT: - proto_tree_add_item(facility_tree, hf_x25_facility_throughput_called_dte, tvb, *offset+1, 1, ENC_NA); - proto_tree_add_item(facility_tree, hf_x25_throughput_called_dte, tvb, *offset+1, 1, ENC_NA); - break; - case X25_FAC_CUG: - proto_tree_add_item(facility_tree, hf_x25_facility_classA_cug, tvb, *offset+1, 1, ENC_NA); - break; - case X25_FAC_CALLED_MODIF: - proto_tree_add_item(facility_tree, hf_x25_facility_classA_called_motif, tvb, *offset+1, 1, ENC_NA); - break; - case X25_FAC_CUG_OUTGOING_ACC: - proto_tree_add_item(facility_tree, hf_x25_facility_classA_cug_outgoing_acc, tvb, *offset+1, 1, ENC_NA); - break; - case X25_FAC_THROUGHPUT_MIN: - proto_tree_add_item(facility_tree, hf_x25_facility_classA_throughput_min, tvb, *offset+1, 1, ENC_NA); - break; - case X25_FAC_EXPRESS_DATA: - proto_tree_add_item(facility_tree, hf_x25_facility_classA_express_data, tvb, *offset+1, 1, ENC_NA); - break; - default: - proto_tree_add_item(facility_tree, hf_x25_facility_classA_unknown, tvb, *offset+1, 1, ENC_NA); - break; - } - } - (*offset) += 2; - len -= 2; - break; - case X25_FAC_CLASS_B: - proto_item_set_len(ti, 3); - proto_item_append_text(ti, ": %s", - val_to_str(fac, x25_facilities_classB_vals, "Unknown (0x%02X)")); - facility_tree = proto_item_add_subtree(ti, ett_x25_facility); - proto_tree_add_item(facility_tree, hf_x25_facility_class, tvb, *offset, 1, ENC_NA); - proto_tree_add_item(facility_tree, hf_x25_facility_classB, tvb, *offset, 1, ENC_NA); - if (facility_tree) { - switch (fac) { - case X25_FAC_BILATERAL_CUG: - proto_tree_add_item(facility_tree, hf_x25_facility_classB_bilateral_cug, tvb, *offset+1, 2, ENC_BIG_ENDIAN); - break; - case X25_FAC_PACKET_SIZE: - proto_tree_add_item(facility_tree, hf_x25_facility_packet_size_called_dte, tvb, *offset+1, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(facility_tree, hf_x25_facility_packet_size_calling_dte, tvb, *offset+2, 1, ENC_BIG_ENDIAN); - break; - case X25_FAC_WINDOW_SIZE: - proto_tree_add_item(facility_tree, hf_x25_window_size_called_dte, tvb, *offset+1, 1, ENC_NA); - proto_tree_add_item(facility_tree, hf_x25_window_size_calling_dte, tvb, *offset+2, 1, ENC_NA); - break; - case X25_FAC_RPOA_SELECTION: - proto_tree_add_item(facility_tree, hf_x25_facility_data_network_id_code, tvb, *offset+1, 2, ENC_BIG_ENDIAN); - break; - case X25_FAC_CUG_EXT: - proto_tree_add_item(facility_tree, hf_x25_facility_cug_ext, tvb, *offset+1, 2, ENC_BIG_ENDIAN); - break; - case X25_FAC_CUG_OUTGOING_ACC_EXT: - proto_tree_add_item(facility_tree, hf_x25_facility_cug_outgoing_acc_ext, tvb, *offset+1, 2, ENC_BIG_ENDIAN); - break; - case X25_FAC_TRANSIT_DELAY: - proto_tree_add_item(facility_tree, hf_x25_facility_transit_delay, tvb, *offset+1, 2, ENC_BIG_ENDIAN); - break; - default: - proto_tree_add_item(facility_tree, hf_x25_facility_classB_unknown, tvb, *offset+1, 2, ENC_BIG_ENDIAN); - break; - } - } - (*offset) += 3; - len -= 3; - break; - case X25_FAC_CLASS_C: - proto_item_set_len(ti, 4); - proto_item_append_text(ti, ": %s", - val_to_str(fac, x25_facilities_classC_vals, "Unknown (0x%02X)")); - facility_tree = proto_item_add_subtree(ti, ett_x25_facility); - proto_tree_add_item(facility_tree, hf_x25_facility_class, tvb, *offset, 1, ENC_NA); - proto_tree_add_item(facility_tree, hf_x25_facility_classC, tvb, *offset, 1, ENC_NA); - if (facility_tree) { - proto_tree_add_item(facility_tree, hf_x25_facility_classC_unknown, tvb, *offset+1, 2, ENC_BIG_ENDIAN); - } - (*offset) += 4; - len -= 4; - break; - case X25_FAC_CLASS_D: - proto_item_append_text(ti, ": %s", - val_to_str(fac, x25_facilities_classD_vals, "Unknown (0x%02X)")); - facility_tree = proto_item_add_subtree(ti, ett_x25_facility); - proto_tree_add_item(facility_tree, hf_x25_facility_class, tvb, *offset, 1, ENC_NA); - byte1 = tvb_get_guint8(tvb, *offset+1); - proto_item_set_len(ti, byte1+2); - proto_tree_add_item(facility_tree, hf_x25_facility_classD, tvb, *offset, 1, ENC_NA); - proto_tree_add_item(facility_tree, hf_x25_facility_length, tvb, *offset+1, 1, ENC_NA); - if (facility_tree) { - switch (fac) { - case X25_FAC_CALL_DURATION: - { - int i; - - if ((byte1 < 4) || (byte1 % 4)) { - expert_add_info(pinfo, ti, &ei_x25_facility_length); - return; - } - for (i = 0; (i<byte1); i+=4) { - proto_tree_add_text(facility_tree, tvb, *offset+2+i, 4, - "Call duration: %u Day(s) %02X:%02X:%02X Hour(s)", - tvb_get_guint8(tvb, *offset+2+i), - tvb_get_guint8(tvb, *offset+3+i), - tvb_get_guint8(tvb, *offset+4+i), - tvb_get_guint8(tvb, *offset+5+i)); - } - } - break; - case X25_FAC_SEGMENT_COUNT: - { - int i; - - if ((byte1 < 8) || (byte1 % 8)) { - expert_add_info(pinfo, ti, &ei_x25_facility_length); - return; - } - for (i = 0; (i<byte1); i+=8) { - proto_tree_add_text(facility_tree, tvb, *offset+2+i, 4, - "Segments sent to DTE: %02X%02X%02X%02X", - tvb_get_guint8(tvb, *offset+2+i), - tvb_get_guint8(tvb, *offset+3+i), - tvb_get_guint8(tvb, *offset+4+i), - tvb_get_guint8(tvb, *offset+5+i)); - proto_tree_add_text(facility_tree, tvb, *offset+6+i, 4, - "Segments received from DTE: %02X%02X%02X%02X", - tvb_get_guint8(tvb, *offset+6+i), - tvb_get_guint8(tvb, *offset+7+i), - tvb_get_guint8(tvb, *offset+8+i), - tvb_get_guint8(tvb, *offset+9+i)); - } - } - break; - case X25_FAC_CALL_TRANSFER: - { - char *tmpbuf; - - if (byte1 < 2) { - expert_add_info(pinfo, ti, &ei_x25_facility_length); - return; - } - byte2 = tvb_get_guint8(tvb, *offset+2); - if ((byte2 & 0xC0) == 0xC0) { - proto_tree_add_uint_format_value(facility_tree, hf_x25_facility_call_transfer_reason, tvb, - *offset+2, 1, byte2, "call deflection by the originally called DTE address"); - } - else { - proto_tree_add_uint(facility_tree, hf_x25_facility_call_transfer_reason, tvb, *offset+2, 1, byte2); - } - byte3 = tvb_get_guint8(tvb, *offset+3); - proto_tree_add_uint(facility_tree, hf_x25_facility_call_transfer_num_semi_octets, tvb, *offset+4, 1, byte3); - tmpbuf = dte_address_util(tvb, *offset + 4, byte3); - - proto_tree_add_text(facility_tree, tvb, *offset+4, byte1 - 2, - "DTE address: %s", tmpbuf); - } - break; - case X25_FAC_RPOA_SELECTION_EXT: - { - int i; - - if ((byte1 < 2) || (byte1 % 2)) { - expert_add_info(pinfo, ti, &ei_x25_facility_length); - return; - } - for (i = 0; (i<byte1); i+=2) { - proto_tree_add_text(facility_tree, tvb, *offset+2+i, 2, - "Data network identification code: %04X", - tvb_get_ntohs(tvb, *offset+2+i)); - } - } - break; - case X25_FAC_CALLING_ADDR_EXT: - { - char *tmpbuf; - - if (byte1 < 1) { - expert_add_info(pinfo, ti, &ei_x25_facility_length); - return; - } - byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F; - proto_tree_add_uint(facility_tree, hf_x25_facility_calling_addr_ext_num_semi_octets, tvb, *offset+2, 1, byte2); - tmpbuf = dte_address_util(tvb, *offset + 3, byte2); - proto_tree_add_text(facility_tree, tvb, *offset+3, byte1 - 1, - "DTE address: %s", tmpbuf); - } - break; - case X25_FAC_MONETARY_UNIT: - proto_tree_add_item(facility_tree, hf_x25_facility_monetary_unit, tvb, *offset+2, byte1, ENC_NA); - break; - case X25_FAC_NUI: - proto_tree_add_item(facility_tree, hf_x25_facility_nui, tvb, *offset+2, byte1, ENC_NA); - break; - case X25_FAC_CALLED_ADDR_EXT: - { - char *tmpbuf; - - if (byte1 < 1) { - expert_add_info(pinfo, ti, &ei_x25_facility_length); - return; - } - byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F; - proto_tree_add_uint(facility_tree, hf_x25_facility_called_addr_ext_num_semi_octets, tvb, *offset+2, 1, byte2); - tmpbuf = dte_address_util(tvb, *offset+3, byte2); - - proto_tree_add_text(facility_tree, tvb, *offset+3, byte1 - 1, - "DTE address: %s", tmpbuf); - } - break; - case X25_FAC_ETE_TRANSIT_DELAY: - if (byte1 < 2) - break; - proto_tree_add_item(facility_tree, hf_x25_facility_cumulative_ete_transit_delay, tvb, *offset+2, 2, ENC_BIG_ENDIAN); - if (byte1 < 4) - break; - proto_tree_add_item(facility_tree, hf_x25_facility_requested_ete_transit_delay, tvb, *offset+4, 2, ENC_BIG_ENDIAN); - if (byte1 < 6) - break; - proto_tree_add_item(facility_tree, hf_x25_facility_max_acceptable_ete_transit_delay, tvb, *offset+6, 2, ENC_BIG_ENDIAN); - break; - case X25_FAC_CALL_DEFLECT: - { - char *tmpbuf; - - if (byte1 < 2) { - expert_add_info(pinfo, ti, &ei_x25_facility_length); - return; - } - byte2 = tvb_get_guint8(tvb, *offset+2); - if ((byte2 & 0xC0) == 0xC0) - proto_tree_add_text(facility_tree, tvb, *offset+2, 1, - "Reason: call DTE originated"); - else - proto_tree_add_text(facility_tree, tvb, *offset+2, 1, - "Reason: unknown"); - byte3 = tvb_get_guint8(tvb, *offset+3); - proto_tree_add_uint(facility_tree, hf_x25_facility_call_deflect_num_semi_octets, tvb, *offset+3, 1, byte3); - tmpbuf = dte_address_util(tvb, *offset+4, byte3); - - proto_tree_add_text(facility_tree, tvb, *offset+4, byte1 - 2, - "Alternative DTE address: %s", tmpbuf); - } - break; - case X25_FAC_PRIORITY: - if (byte1 < 1) - break; - add_priority(facility_tree, hf_x25_facility_priority_data, tvb, *offset+2); - if (byte1 < 2) - break; - add_priority(facility_tree, hf_x25_facility_priority_estab_conn, tvb, *offset+3); - if (byte1 < 3) - break; - add_priority(facility_tree, hf_x25_facility_priority_keep_conn, tvb, *offset+4); - if (byte1 < 4) - break; - add_priority(facility_tree, hf_x25_facility_min_acceptable_priority_data, tvb, *offset+5); - if (byte1 < 5) - break; - add_priority(facility_tree, hf_x25_facility_min_acceptable_priority_estab_conn, tvb, *offset+6); - if (byte1 < 6) - break; - add_priority(facility_tree, hf_x25_facility_min_acceptable_priority_keep_conn, tvb, *offset+7); - break; - default: - proto_tree_add_item(facility_tree, hf_x25_facility_classD_unknown, tvb, *offset+2, byte1, ENC_NA); - } - } - byte1 = tvb_get_guint8(tvb, *offset+1); - (*offset) += byte1+2; - len -= byte1+2; - break; - } - } + guint8 fac, byte1, byte2, byte3; + guint32 len; /* facilities length */ + proto_item *ti = NULL; + proto_tree *facilities_tree = NULL, *facility_tree = NULL; + + len = tvb_get_guint8(tvb, *offset); + if (len && tree) { + facilities_tree = proto_tree_add_subtree(tree, tvb, *offset, len + 1, + ett_x25_facilities, NULL, "Facilities"); + proto_tree_add_item(facilities_tree, hf_x25_facilities_length, tvb, *offset, 1, ENC_NA); + } + (*offset)++; + + while (len > 0) { + ti = proto_tree_add_item(facilities_tree, hf_x25_facility, tvb, *offset, -1, ENC_NA); + fac = tvb_get_guint8(tvb, *offset); + switch(fac & X25_FAC_CLASS_MASK) { + case X25_FAC_CLASS_A: + proto_item_set_len(ti, 2); + proto_item_append_text(ti, ": %s", + val_to_str(fac, x25_facilities_classA_vals, "Unknown (0x%02X)")); + facility_tree = proto_item_add_subtree(ti, ett_x25_facility); + proto_tree_add_item(facility_tree, hf_x25_facility_class, tvb, *offset, 1, ENC_NA); + proto_tree_add_item(facility_tree, hf_x25_facility_classA, tvb, *offset, 1, ENC_NA); + if (facility_tree) { + switch (fac) { + case X25_FAC_COMP_MARK: + proto_tree_add_item(facility_tree, hf_x25_facility_classA_comp_mark, tvb, *offset+1, 1, ENC_NA); + break; + case X25_FAC_REVERSE: + proto_tree_add_item(facility_tree, hf_x25_facility_classA_reverse, tvb, *offset+1, 1, ENC_NA); + proto_tree_add_item(facility_tree, hf_x25_fast_select, tvb, *offset+1, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(facility_tree, hf_x25_icrd, tvb, *offset+1, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(facility_tree, hf_x25_facility_reverse_charging, tvb, *offset+1, 1, ENC_BIG_ENDIAN); + break; + case X25_FAC_CHARGING_INFO: + proto_tree_add_item(facility_tree, hf_x25_facility_classA_charging_info, tvb, *offset+1, 1, ENC_NA); + proto_tree_add_item(facility_tree, hf_x25_facility_charging_info, tvb, *offset+1, 1, ENC_NA); + break; + case X25_FAC_THROUGHPUT: + proto_tree_add_item(facility_tree, hf_x25_facility_throughput_called_dte, tvb, *offset+1, 1, ENC_NA); + proto_tree_add_item(facility_tree, hf_x25_throughput_called_dte, tvb, *offset+1, 1, ENC_NA); + break; + case X25_FAC_CUG: + proto_tree_add_item(facility_tree, hf_x25_facility_classA_cug, tvb, *offset+1, 1, ENC_NA); + break; + case X25_FAC_CALLED_MODIF: + proto_tree_add_item(facility_tree, hf_x25_facility_classA_called_motif, tvb, *offset+1, 1, ENC_NA); + break; + case X25_FAC_CUG_OUTGOING_ACC: + proto_tree_add_item(facility_tree, hf_x25_facility_classA_cug_outgoing_acc, tvb, *offset+1, 1, ENC_NA); + break; + case X25_FAC_THROUGHPUT_MIN: + proto_tree_add_item(facility_tree, hf_x25_facility_classA_throughput_min, tvb, *offset+1, 1, ENC_NA); + break; + case X25_FAC_EXPRESS_DATA: + proto_tree_add_item(facility_tree, hf_x25_facility_classA_express_data, tvb, *offset+1, 1, ENC_NA); + break; + default: + proto_tree_add_item(facility_tree, hf_x25_facility_classA_unknown, tvb, *offset+1, 1, ENC_NA); + break; + } + } + (*offset) += 2; + len -= 2; + break; + case X25_FAC_CLASS_B: + proto_item_set_len(ti, 3); + proto_item_append_text(ti, ": %s", + val_to_str(fac, x25_facilities_classB_vals, "Unknown (0x%02X)")); + facility_tree = proto_item_add_subtree(ti, ett_x25_facility); + proto_tree_add_item(facility_tree, hf_x25_facility_class, tvb, *offset, 1, ENC_NA); + proto_tree_add_item(facility_tree, hf_x25_facility_classB, tvb, *offset, 1, ENC_NA); + if (facility_tree) { + switch (fac) { + case X25_FAC_BILATERAL_CUG: + proto_tree_add_item(facility_tree, hf_x25_facility_classB_bilateral_cug, tvb, *offset+1, 2, ENC_BIG_ENDIAN); + break; + case X25_FAC_PACKET_SIZE: + proto_tree_add_item(facility_tree, hf_x25_facility_packet_size_called_dte, tvb, *offset+1, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(facility_tree, hf_x25_facility_packet_size_calling_dte, tvb, *offset+2, 1, ENC_BIG_ENDIAN); + break; + case X25_FAC_WINDOW_SIZE: + proto_tree_add_item(facility_tree, hf_x25_window_size_called_dte, tvb, *offset+1, 1, ENC_NA); + proto_tree_add_item(facility_tree, hf_x25_window_size_calling_dte, tvb, *offset+2, 1, ENC_NA); + break; + case X25_FAC_RPOA_SELECTION: + proto_tree_add_item(facility_tree, hf_x25_facility_data_network_id_code, tvb, *offset+1, 2, ENC_BIG_ENDIAN); + break; + case X25_FAC_CUG_EXT: + proto_tree_add_item(facility_tree, hf_x25_facility_cug_ext, tvb, *offset+1, 2, ENC_BIG_ENDIAN); + break; + case X25_FAC_CUG_OUTGOING_ACC_EXT: + proto_tree_add_item(facility_tree, hf_x25_facility_cug_outgoing_acc_ext, tvb, *offset+1, 2, ENC_BIG_ENDIAN); + break; + case X25_FAC_TRANSIT_DELAY: + proto_tree_add_item(facility_tree, hf_x25_facility_transit_delay, tvb, *offset+1, 2, ENC_BIG_ENDIAN); + break; + default: + proto_tree_add_item(facility_tree, hf_x25_facility_classB_unknown, tvb, *offset+1, 2, ENC_BIG_ENDIAN); + break; + } + } + (*offset) += 3; + len -= 3; + break; + case X25_FAC_CLASS_C: + proto_item_set_len(ti, 4); + proto_item_append_text(ti, ": %s", + val_to_str(fac, x25_facilities_classC_vals, "Unknown (0x%02X)")); + facility_tree = proto_item_add_subtree(ti, ett_x25_facility); + proto_tree_add_item(facility_tree, hf_x25_facility_class, tvb, *offset, 1, ENC_NA); + proto_tree_add_item(facility_tree, hf_x25_facility_classC, tvb, *offset, 1, ENC_NA); + if (facility_tree) { + proto_tree_add_item(facility_tree, hf_x25_facility_classC_unknown, tvb, *offset+1, 2, ENC_BIG_ENDIAN); + } + (*offset) += 4; + len -= 4; + break; + case X25_FAC_CLASS_D: + proto_item_append_text(ti, ": %s", + val_to_str(fac, x25_facilities_classD_vals, "Unknown (0x%02X)")); + facility_tree = proto_item_add_subtree(ti, ett_x25_facility); + proto_tree_add_item(facility_tree, hf_x25_facility_class, tvb, *offset, 1, ENC_NA); + byte1 = tvb_get_guint8(tvb, *offset+1); + proto_item_set_len(ti, byte1+2); + proto_tree_add_item(facility_tree, hf_x25_facility_classD, tvb, *offset, 1, ENC_NA); + proto_tree_add_item(facility_tree, hf_x25_facility_length, tvb, *offset+1, 1, ENC_NA); + if (facility_tree) { + switch (fac) { + case X25_FAC_CALL_DURATION: + { + int i; + + if ((byte1 < 4) || (byte1 % 4)) { + expert_add_info(pinfo, ti, &ei_x25_facility_length); + return; + } + for (i = 0; (i<byte1); i+=4) { + proto_tree_add_text(facility_tree, tvb, *offset+2+i, 4, + "Call duration: %u Day(s) %02X:%02X:%02X Hour(s)", + tvb_get_guint8(tvb, *offset+2+i), + tvb_get_guint8(tvb, *offset+3+i), + tvb_get_guint8(tvb, *offset+4+i), + tvb_get_guint8(tvb, *offset+5+i)); + } + } + break; + case X25_FAC_SEGMENT_COUNT: + { + int i; + + if ((byte1 < 8) || (byte1 % 8)) { + expert_add_info(pinfo, ti, &ei_x25_facility_length); + return; + } + for (i = 0; (i<byte1); i+=8) { + proto_tree_add_text(facility_tree, tvb, *offset+2+i, 4, + "Segments sent to DTE: %02X%02X%02X%02X", + tvb_get_guint8(tvb, *offset+2+i), + tvb_get_guint8(tvb, *offset+3+i), + tvb_get_guint8(tvb, *offset+4+i), + tvb_get_guint8(tvb, *offset+5+i)); + proto_tree_add_text(facility_tree, tvb, *offset+6+i, 4, + "Segments received from DTE: %02X%02X%02X%02X", + tvb_get_guint8(tvb, *offset+6+i), + tvb_get_guint8(tvb, *offset+7+i), + tvb_get_guint8(tvb, *offset+8+i), + tvb_get_guint8(tvb, *offset+9+i)); + } + } + break; + case X25_FAC_CALL_TRANSFER: + { + char *tmpbuf; + + if (byte1 < 2) { + expert_add_info(pinfo, ti, &ei_x25_facility_length); + return; + } + byte2 = tvb_get_guint8(tvb, *offset+2); + if ((byte2 & 0xC0) == 0xC0) { + proto_tree_add_uint_format_value(facility_tree, hf_x25_facility_call_transfer_reason, tvb, + *offset+2, 1, byte2, "call deflection by the originally called DTE address"); + } + else { + proto_tree_add_uint(facility_tree, hf_x25_facility_call_transfer_reason, tvb, *offset+2, 1, byte2); + } + byte3 = tvb_get_guint8(tvb, *offset+3); + proto_tree_add_uint(facility_tree, hf_x25_facility_call_transfer_num_semi_octets, tvb, *offset+4, 1, byte3); + tmpbuf = dte_address_util(tvb, *offset + 4, byte3); + + proto_tree_add_text(facility_tree, tvb, *offset+4, byte1 - 2, + "DTE address: %s", tmpbuf); + } + break; + case X25_FAC_RPOA_SELECTION_EXT: + { + int i; + + if ((byte1 < 2) || (byte1 % 2)) { + expert_add_info(pinfo, ti, &ei_x25_facility_length); + return; + } + for (i = 0; (i<byte1); i+=2) { + proto_tree_add_text(facility_tree, tvb, *offset+2+i, 2, + "Data network identification code: %04X", + tvb_get_ntohs(tvb, *offset+2+i)); + } + } + break; + case X25_FAC_CALLING_ADDR_EXT: + { + char *tmpbuf; + + if (byte1 < 1) { + expert_add_info(pinfo, ti, &ei_x25_facility_length); + return; + } + byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F; + proto_tree_add_uint(facility_tree, hf_x25_facility_calling_addr_ext_num_semi_octets, tvb, *offset+2, 1, byte2); + tmpbuf = dte_address_util(tvb, *offset + 3, byte2); + proto_tree_add_text(facility_tree, tvb, *offset+3, byte1 - 1, + "DTE address: %s", tmpbuf); + } + break; + case X25_FAC_MONETARY_UNIT: + proto_tree_add_item(facility_tree, hf_x25_facility_monetary_unit, tvb, *offset+2, byte1, ENC_NA); + break; + case X25_FAC_NUI: + proto_tree_add_item(facility_tree, hf_x25_facility_nui, tvb, *offset+2, byte1, ENC_NA); + break; + case X25_FAC_CALLED_ADDR_EXT: + { + char *tmpbuf; + + if (byte1 < 1) { + expert_add_info(pinfo, ti, &ei_x25_facility_length); + return; + } + byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F; + proto_tree_add_uint(facility_tree, hf_x25_facility_called_addr_ext_num_semi_octets, tvb, *offset+2, 1, byte2); + tmpbuf = dte_address_util(tvb, *offset+3, byte2); + + proto_tree_add_text(facility_tree, tvb, *offset+3, byte1 - 1, + "DTE address: %s", tmpbuf); + } + break; + case X25_FAC_ETE_TRANSIT_DELAY: + if (byte1 < 2) + break; + proto_tree_add_item(facility_tree, hf_x25_facility_cumulative_ete_transit_delay, tvb, *offset+2, 2, ENC_BIG_ENDIAN); + if (byte1 < 4) + break; + proto_tree_add_item(facility_tree, hf_x25_facility_requested_ete_transit_delay, tvb, *offset+4, 2, ENC_BIG_ENDIAN); + if (byte1 < 6) + break; + proto_tree_add_item(facility_tree, hf_x25_facility_max_acceptable_ete_transit_delay, tvb, *offset+6, 2, ENC_BIG_ENDIAN); + break; + case X25_FAC_CALL_DEFLECT: + { + char *tmpbuf; + + if (byte1 < 2) { + expert_add_info(pinfo, ti, &ei_x25_facility_length); + return; + } + byte2 = tvb_get_guint8(tvb, *offset+2); + if ((byte2 & 0xC0) == 0xC0) + proto_tree_add_text(facility_tree, tvb, *offset+2, 1, + "Reason: call DTE originated"); + else + proto_tree_add_text(facility_tree, tvb, *offset+2, 1, + "Reason: unknown"); + byte3 = tvb_get_guint8(tvb, *offset+3); + proto_tree_add_uint(facility_tree, hf_x25_facility_call_deflect_num_semi_octets, tvb, *offset+3, 1, byte3); + tmpbuf = dte_address_util(tvb, *offset+4, byte3); + + proto_tree_add_text(facility_tree, tvb, *offset+4, byte1 - 2, + "Alternative DTE address: %s", tmpbuf); + } + break; + case X25_FAC_PRIORITY: + if (byte1 < 1) + break; + add_priority(facility_tree, hf_x25_facility_priority_data, tvb, *offset+2); + if (byte1 < 2) + break; + add_priority(facility_tree, hf_x25_facility_priority_estab_conn, tvb, *offset+3); + if (byte1 < 3) + break; + add_priority(facility_tree, hf_x25_facility_priority_keep_conn, tvb, *offset+4); + if (byte1 < 4) + break; + add_priority(facility_tree, hf_x25_facility_min_acceptable_priority_data, tvb, *offset+5); + if (byte1 < 5) + break; + add_priority(facility_tree, hf_x25_facility_min_acceptable_priority_estab_conn, tvb, *offset+6); + if (byte1 < 6) + break; + add_priority(facility_tree, hf_x25_facility_min_acceptable_priority_keep_conn, tvb, *offset+7); + break; + default: + proto_tree_add_item(facility_tree, hf_x25_facility_classD_unknown, tvb, *offset+2, byte1, ENC_NA); + } + } + byte1 = tvb_get_guint8(tvb, *offset+1); + (*offset) += byte1+2; + len -= byte1+2; + break; + } + } } static void x25_ntoa(proto_tree *tree, int *offset, tvbuff_t *tvb, - packet_info *pinfo, gboolean is_registration) + packet_info *pinfo, gboolean is_registration) { int len1, len2; int i; @@ -1046,23 +1046,23 @@ x25_ntoa(proto_tree *tree, int *offset, tvbuff_t *tvb, first=addr1; second=addr2; for (i = 0; i < (len1 + len2); i++) { - if (i < len1) { - if (i % 2 != 0) { - *first++ = ((byte >> 0) & 0x0F) + '0'; - localoffset++; - byte = tvb_get_guint8(tvb, localoffset); - } else { - *first++ = ((byte >> 4) & 0x0F) + '0'; - } - } else { - if (i % 2 != 0) { - *second++ = ((byte >> 0) & 0x0F) + '0'; - localoffset++; - byte = tvb_get_guint8(tvb, localoffset); - } else { - *second++ = ((byte >> 4) & 0x0F) + '0'; - } - } + if (i < len1) { + if (i % 2 != 0) { + *first++ = ((byte >> 0) & 0x0F) + '0'; + localoffset++; + byte = tvb_get_guint8(tvb, localoffset); + } else { + *first++ = ((byte >> 4) & 0x0F) + '0'; + } + } else { + if (i % 2 != 0) { + *second++ = ((byte >> 0) & 0x0F) + '0'; + localoffset++; + byte = tvb_get_guint8(tvb, localoffset); + } else { + *second++ = ((byte >> 4) & 0x0F) + '0'; + } + } } *first = '\0'; @@ -1070,30 +1070,30 @@ x25_ntoa(proto_tree *tree, int *offset, tvbuff_t *tvb, if (len1) { col_add_str(pinfo->cinfo, COL_RES_DL_DST, addr1); - if (tree) - proto_tree_add_text(tree, tvb, *offset, - (len1 + 1) / 2, - is_registration ? - "DCE address: %s" : - "Called address: %s", - addr1); + if (tree) + proto_tree_add_text(tree, tvb, *offset, + (len1 + 1) / 2, + is_registration ? + "DCE address: %s" : + "Called address: %s", + addr1); } if (len2) { col_add_str(pinfo->cinfo, COL_RES_DL_SRC, addr2); - if (tree) - proto_tree_add_text(tree, tvb, *offset + len1/2, - (len2+1)/2+(len1%2+(len2+1)%2)/2, - is_registration ? - "DTE address: %s" : - "Calling address: %s", - addr2); + if (tree) + proto_tree_add_text(tree, tvb, *offset + len1/2, + (len2+1)/2+(len1%2+(len2+1)%2)/2, + is_registration ? + "DTE address: %s" : + "Calling address: %s", + addr2); } (*offset) += ((len1 + len2 + 1) / 2); } static void x25_toa(proto_tree *tree, int *offset, tvbuff_t *tvb, - packet_info *pinfo) + packet_info *pinfo) { int len1, len2; int i; @@ -1107,17 +1107,17 @@ x25_toa(proto_tree *tree, int *offset, tvbuff_t *tvb, len1 = tvb_get_guint8(tvb, *offset); if (tree) { - proto_tree_add_text(tree, tvb, *offset, 1, - "Called address length: %u", - len1); + proto_tree_add_text(tree, tvb, *offset, 1, + "Called address length: %u", + len1); } (*offset)++; len2 = tvb_get_guint8(tvb, *offset); if (tree) { - proto_tree_add_text(tree, tvb, *offset, 1, - "Calling address length: %u", - len2); + proto_tree_add_text(tree, tvb, *offset, 1, + "Calling address length: %u", + len2); } (*offset)++; @@ -1133,23 +1133,23 @@ x25_toa(proto_tree *tree, int *offset, tvbuff_t *tvb, first=addr1; second=addr2; for (i = 0; i < (len1 + len2); i++) { - if (i < len1) { - if (i % 2 != 0) { - *first++ = ((byte >> 0) & 0x0F) + '0'; - localoffset++; - byte = tvb_get_guint8(tvb, localoffset); - } else { - *first++ = ((byte >> 4) & 0x0F) + '0'; - } - } else { - if (i % 2 != 0) { - *second++ = ((byte >> 0) & 0x0F) + '0'; - localoffset++; - byte = tvb_get_guint8(tvb, localoffset); - } else { - *second++ = ((byte >> 4) & 0x0F) + '0'; - } - } + if (i < len1) { + if (i % 2 != 0) { + *first++ = ((byte >> 0) & 0x0F) + '0'; + localoffset++; + byte = tvb_get_guint8(tvb, localoffset); + } else { + *first++ = ((byte >> 4) & 0x0F) + '0'; + } + } else { + if (i % 2 != 0) { + *second++ = ((byte >> 0) & 0x0F) + '0'; + localoffset++; + byte = tvb_get_guint8(tvb, localoffset); + } else { + *second++ = ((byte >> 4) & 0x0F) + '0'; + } + } } *first = '\0'; @@ -1157,19 +1157,19 @@ x25_toa(proto_tree *tree, int *offset, tvbuff_t *tvb, if (len1) { col_add_str(pinfo->cinfo, COL_RES_DL_DST, addr1); - if (tree) - proto_tree_add_text(tree, tvb, *offset, - (len1 + 1) / 2, - "Called address: %s", - addr1); + if (tree) + proto_tree_add_text(tree, tvb, *offset, + (len1 + 1) / 2, + "Called address: %s", + addr1); } if (len2) { col_add_str(pinfo->cinfo, COL_RES_DL_SRC, addr2); - if (tree) - proto_tree_add_text(tree, tvb, *offset + len1/2, - (len2+1)/2+(len1%2+(len2+1)%2)/2, - "Calling address: %s", - addr2); + if (tree) + proto_tree_add_text(tree, tvb, *offset + len1/2, + (len2+1)/2+(len1%2+(len2+1)%2)/2, + "Calling address: %s", + addr2); } (*offset) += ((len1 + len2 + 1) / 2); } @@ -1184,95 +1184,95 @@ get_x25_pkt_len(tvbuff_t *tvb) switch (byte2) { case X25_CALL_REQUEST: - bytex = tvb_get_guint8(tvb, 3); - called_len = (bytex >> 0) & 0x0F; - calling_len = (bytex >> 4) & 0x0F; - length = 4 + (called_len + calling_len + 1) / 2; /* addr */ - if (length < tvb_reported_length(tvb)) - length += (1 + tvb_get_guint8(tvb, length)); /* facilities */ + bytex = tvb_get_guint8(tvb, 3); + called_len = (bytex >> 0) & 0x0F; + calling_len = (bytex >> 4) & 0x0F; + length = 4 + (called_len + calling_len + 1) / 2; /* addr */ + if (length < tvb_reported_length(tvb)) + length += (1 + tvb_get_guint8(tvb, length)); /* facilities */ - return MIN(tvb_reported_length(tvb),length); + return MIN(tvb_reported_length(tvb),length); case X25_CALL_ACCEPTED: - /* The calling/called address length byte (following the packet type) - * is not mandatory, so we must check the packet length before trying - * to read it */ - if (tvb_reported_length(tvb) == 3) - return(3); - bytex = tvb_get_guint8(tvb, 3); - called_len = (bytex >> 0) & 0x0F; - calling_len = (bytex >> 4) & 0x0F; - length = 4 + (called_len + calling_len + 1) / 2; /* addr */ - if (length < tvb_reported_length(tvb)) - length += (1 + tvb_get_guint8(tvb, length)); /* facilities */ - - return MIN(tvb_reported_length(tvb),length); + /* The calling/called address length byte (following the packet type) + * is not mandatory, so we must check the packet length before trying + * to read it */ + if (tvb_reported_length(tvb) == 3) + return(3); + bytex = tvb_get_guint8(tvb, 3); + called_len = (bytex >> 0) & 0x0F; + calling_len = (bytex >> 4) & 0x0F; + length = 4 + (called_len + calling_len + 1) / 2; /* addr */ + if (length < tvb_reported_length(tvb)) + length += (1 + tvb_get_guint8(tvb, length)); /* facilities */ + + return MIN(tvb_reported_length(tvb),length); case X25_CLEAR_REQUEST: case X25_RESET_REQUEST: case X25_RESTART_REQUEST: - return MIN(tvb_reported_length(tvb),5); + return MIN(tvb_reported_length(tvb),5); case X25_DIAGNOSTIC: - return MIN(tvb_reported_length(tvb),4); + return MIN(tvb_reported_length(tvb),4); case X25_CLEAR_CONFIRMATION: case X25_INTERRUPT: case X25_INTERRUPT_CONFIRMATION: case X25_RESET_CONFIRMATION: case X25_RESTART_CONFIRMATION: - return MIN(tvb_reported_length(tvb),3); + return MIN(tvb_reported_length(tvb),3); case X25_REGISTRATION_REQUEST: - bytex = tvb_get_guint8(tvb, 3); - dce_len = (bytex >> 0) & 0x0F; - dte_len = (bytex >> 4) & 0x0F; - length = 4 + (dte_len + dce_len + 1) / 2; /* addr */ - if (length < tvb_reported_length(tvb)) - length += (1 + tvb_get_guint8(tvb, length)); /* registration */ + bytex = tvb_get_guint8(tvb, 3); + dce_len = (bytex >> 0) & 0x0F; + dte_len = (bytex >> 4) & 0x0F; + length = 4 + (dte_len + dce_len + 1) / 2; /* addr */ + if (length < tvb_reported_length(tvb)) + length += (1 + tvb_get_guint8(tvb, length)); /* registration */ - return MIN(tvb_reported_length(tvb),length); + return MIN(tvb_reported_length(tvb),length); case X25_REGISTRATION_CONFIRMATION: - bytex = tvb_get_guint8(tvb, 5); - dce_len = (bytex >> 0) & 0x0F; - dte_len = (bytex >> 4) & 0x0F; - length = 6 + (dte_len + dce_len + 1) / 2; /* addr */ - if (length < tvb_reported_length(tvb)) - length += (1 + tvb_get_guint8(tvb, length)); /* registration */ - - return MIN(tvb_reported_length(tvb),length); + bytex = tvb_get_guint8(tvb, 5); + dce_len = (bytex >> 0) & 0x0F; + dte_len = (bytex >> 4) & 0x0F; + length = 6 + (dte_len + dce_len + 1) / 2; /* addr */ + if (length < tvb_reported_length(tvb)) + length += (1 + tvb_get_guint8(tvb, length)); /* registration */ + + return MIN(tvb_reported_length(tvb),length); } if (PACKET_IS_DATA(byte2)) - return MIN(tvb_reported_length(tvb),3); + return MIN(tvb_reported_length(tvb),3); switch (PACKET_TYPE_FC(byte2)) { case X25_RR: - return MIN(tvb_reported_length(tvb),3); + return MIN(tvb_reported_length(tvb),3); case X25_RNR: - return MIN(tvb_reported_length(tvb),3); + return MIN(tvb_reported_length(tvb),3); case X25_REJ: - return MIN(tvb_reported_length(tvb),3); + return MIN(tvb_reported_length(tvb),3); } return 0; } static const value_string prt_id_vals[] = { - {PRT_ID_ISO_8073, "ISO 8073 COTP"}, - {PRT_ID_ISO_8602, "ISO 8602 CLTP"}, - {PRT_ID_ISO_10736_ISO_8073, "ISO 10736 in conjunction with ISO 8073 COTP"}, - {PRT_ID_ISO_10736_ISO_8602, "ISO 10736 in conjunction with ISO 8602 CLTP"}, - {0x00, NULL} + {PRT_ID_ISO_8073, "ISO 8073 COTP"}, + {PRT_ID_ISO_8602, "ISO 8602 CLTP"}, + {PRT_ID_ISO_10736_ISO_8073, "ISO 10736 in conjunction with ISO 8073 COTP"}, + {PRT_ID_ISO_10736_ISO_8602, "ISO 10736 in conjunction with ISO 8602 CLTP"}, + {0x00, NULL} }; static const value_string sharing_strategy_vals[] = { - {0x00, "No sharing"}, - {0x00, NULL} + {0x00, "No sharing"}, + {0x00, NULL} }; static void @@ -1319,17 +1319,17 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, x25_pkt_len = get_x25_pkt_len(tvb); if (x25_pkt_len < 3) /* packet too short */ { - col_set_str(pinfo->cinfo, COL_INFO, "Invalid/short X.25 packet"); - if (tree) - proto_tree_add_protocol_format(tree, proto_x25, tvb, 0, -1, - "Invalid/short X.25 packet"); - return; + col_set_str(pinfo->cinfo, COL_INFO, "Invalid/short X.25 packet"); + if (tree) + proto_tree_add_protocol_format(tree, proto_x25, tvb, 0, -1, + "Invalid/short X.25 packet"); + return; } pkt_type = tvb_get_guint8(tvb, 2); if (PACKET_IS_DATA(pkt_type)) { - if (bytes0_1 & X25_QBIT) - q_bit_set = TRUE; + if (bytes0_1 & X25_QBIT) + q_bit_set = TRUE; } if (tree) { @@ -1362,589 +1362,589 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case X25_CALL_REQUEST: switch (dir) { - case X25_FROM_DCE: - short_name = "Inc. call"; - long_name = "Incoming call"; - break; - - case X25_FROM_DTE: - short_name = "Call req."; - long_name = "Call request"; - break; - - case X25_UNKNOWN: - short_name = "Inc. call/Call req."; - long_name = "Incoming call/Call request"; - break; - } - col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d", short_name, vc); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, - 0, 2, bytes0_1); - proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, - X25_CALL_REQUEST, "%s", long_name); - } - localoffset = 3; - if (localoffset < x25_pkt_len) { /* calling/called addresses */ - if (toa) - x25_toa(x25_tree, (gint*)&localoffset, tvb, pinfo); - else - x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, FALSE); - } - - if (localoffset < x25_pkt_len) /* facilities */ - dump_facilities(x25_tree, (gint*)&localoffset, tvb, pinfo); - - if (localoffset < tvb_reported_length(tvb)) /* user data */ - { - - userdata_tree = proto_tree_add_subtree(x25_tree, tvb, localoffset, -1, - ett_x25_user_data, &ti, "User data"); - - /* X.263/ISO 9577 says that: - - When CLNP or ESIS are run over X.25, the SPI - is 0x81 or 0x82, respectively; those are the - NLPIDs for those protocol. - - When X.224/ISO 8073 COTP is run over X.25, and - when ISO 11570 explicit identification is being - used, the first octet of the user data field is - a TPDU length field, and the rest is "as defined - in ITU-T Rec. X.225 | ISO/IEC 8073, Annex B, - or ITU-T Rec. X.264 and ISO/IEC 11570". - - When X.264/ISO 11570 default identification is - being used, there is no user data field in the - CALL REQUEST packet. This is for X.225/ISO 8073 - COTP. - - It also says that SPI values from 0x03 through 0x3f are - reserved and are in use by X.224/ISO 8073 Annex B and - X.264/ISO 11570. The note says that those values are - not NLPIDs, they're "used by the respective higher layer - protocol" and "not used for higher layer protocol - identification". I infer from this and from what - X.264/ISO 11570 says that this means that values in those - range are valid values for the first octet of an - X.224/ISO 8073 packet or for X.264/ISO 11570. - - Annex B of X.225/ISO 8073 mentions some additional TPDU - types that can be put in what I presume is the user - data of connect requests. It says that: - - The sending transport entity shall: - - a) either not transmit any TPDU in the NS-user data - parameter of the N-CONNECT request primitive; or - - b) transmit the UN-TPDU (see ITU-T Rec. X.264 and - ISO/IEC 11570) followed by the NCM-TPDU in the - NS-user data parameter of the N-CONNECT request - primitive. - - I don't know if this means that the user data field - will contain a UN TPDU followed by an NCM TPDU or not. - - X.264/ISO 11570 says that: - - When default identification is being used, - X.225/ISO 8073 COTP is identified. No user data - is sent in the network-layer connection request. - - When explicit identification is being used, - the user data is a UN TPDU ("Use of network - connection TPDU"), which specifies the transport - protocol to use over this network connection. - It also says that the length of a UN TPDU shall - not exceed 32 octets, i.e. shall not exceed 0x20; - it says this is "due to the desire not to conflict - with the protocol identifier field carried by X.25 - CALL REQUEST/INCOMING CALL packets", and says that - field has values specified in X.244. X.244 has been - superseded by X.263/ISO 9577, so that presumably - means the goal is to allow a UN TPDU's length - field to be distinguished from an NLPID, allowing - you to tell whether X.264/ISO 11570 explicit - identification is being used or an NLPID is - being used as the SPI. - - I read this as meaning that, if the ISO mechanisms are - used to identify the protocol being carried over X.25: - - if there's no user data in the CALL REQUEST/ - INCOMING CALL packet, it's COTP; - - if there is user data, then: - - if the first octet is less than or equal to - 32, it might be a UN TPDU, and that identifies - the transport protocol being used, and - it may be followed by more data, such - as a COTP NCM TPDU if it's COTP; - - if the first octet is greater than 32, it's - an NLPID, *not* a TPDU length, and the - stuff following it is *not* a TPDU. - - Figure A.2 of X.263/ISO 9577 seems to say that the - first octet of the user data is a TPDU length field, - in the range 0x03 through 0x82, and says they are - for X.225/ISO 8073 Annex B or X.264/ISO 11570. - - However, X.264/ISO 11570 seems to imply that the length - field would be that of a UN TPDU, which must be less - than or equal to 0x20, and X.225/ISO 8073 Annex B seems - to indicate that the user data must begin with - an X.264/ISO 11570 UN TPDU, so I'd say that A.2 should - have said "in the range 0x03 through 0x20", instead - (the length value doesn't include the length field, - and the minimum UN TPDU has length, type, PRT-ID, - and SHARE, so that's 3 bytes without the length). */ - spi = tvb_get_guint8(tvb, localoffset); - if (spi > 32 || spi < 3) { - /* First octet is > 32, or < 3, so the user data isn't an - X.264/ISO 11570 UN TPDU */ - is_x_264 = FALSE; - } else { - /* First octet is >= 3 and <= 32, so the user data *might* - be an X.264/ISO 11570 UN TPDU. Check whether we have - enough data to see if it is. */ - if (tvb_bytes_exist(tvb, localoffset+1, 1)) { - /* We do; check whether the second octet is 1. */ - if (tvb_get_guint8(tvb, localoffset+1) == 0x01) { - /* Yes, the second byte is 1, so it looks like - a UN TPDU. */ - is_x_264 = TRUE; - } else { - /* No, the second byte is not 1, so it's not a - UN TPDU. */ - is_x_264 = FALSE; - } - } else { - /* We can't see the second byte of the putative UN - TPDU, so we don't know if that's what it is. */ - is_x_264 = -1; - } - } - if (is_x_264 == -1) { - /* - * We don't know what it is; just skip it. - */ - localoffset = tvb_length(tvb); - } else if (is_x_264) { - /* It looks like an X.264 UN TPDU, so show it as such. */ - if (userdata_tree) { - proto_tree_add_item( userdata_tree, hf_x264_length_indicator, tvb, localoffset, 1, ENC_NA); - proto_tree_add_item( userdata_tree, hf_x264_un_tpdu_id, tvb, localoffset+1, 1, ENC_NA); - } - prt_id = tvb_get_guint8(tvb, localoffset+2); - if (userdata_tree) { - proto_tree_add_item( userdata_tree, hf_x264_protocol_id, tvb, localoffset+2, 1, ENC_NA); - proto_tree_add_item( userdata_tree, hf_x264_sharing_strategy, tvb, localoffset+3, 1, ENC_NA); - } - - /* XXX - dissect the variable part? */ - - /* The length doesn't include the length octet itself. */ - localoffset += spi + 1; - - switch (prt_id) { - - case PRT_ID_ISO_8073: - /* ISO 8073 COTP */ - if (!pinfo->fd->flags.visited) - x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle); - /* XXX - dissect the rest of the user data as COTP? - That needs support for NCM TPDUs, etc. */ - break; - - case PRT_ID_ISO_8602: - /* ISO 8602 CLTP */ - if (!pinfo->fd->flags.visited) - x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle); - break; - } - } else if (is_x_264 == 0) { - /* It doesn't look like a UN TPDU, so compare the first - octet of the CALL REQUEST packet with various X.263/ - ISO 9577 NLPIDs, as per Annex A of X.263/ISO 9577. */ - - if (userdata_tree) { - proto_tree_add_item( userdata_tree, hf_x263_sec_protocol_id, tvb, localoffset, 1, ENC_NA); - } - - if (!pinfo->fd->flags.visited) { - /* - * Is there a dissector handle for this SPI? - * If so, assign it to this virtual circuit. - */ - dissect = dissector_get_uint_handle(x25_subdissector_table, spi); - if (dissect != NULL) - x25_hash_add_proto_start(vc, pinfo->fd->num, dissect); - } - - /* - * If there's only one octet of user data, it's just - * an NLPID; don't try to dissect it. - */ - if (localoffset + 1 == tvb_reported_length(tvb)) - return; - - /* - * There's more than one octet of user data, so we'll - * dissect it; for some protocols, the NLPID is considered - * to be part of the PDU, so, for those cases, we don't - * skip past it. For other protocols, we skip the NLPID. - */ - switch (spi) { - - case NLPID_ISO8473_CLNP: - case NLPID_ISO9542_ESIS: - case NLPID_ISO10589_ISIS: - case NLPID_ISO10747_IDRP: - case NLPID_SNDCF: - /* - * The NLPID is part of the PDU. Don't skip it. - * But if it's all there is to the PDU, don't - * bother dissecting it. - */ - break; - - case NLPID_SPI_X_29: - /* - * The first 4 bytes of the call user data are - * the SPI plus 3 reserved bytes; they are not - * part of the data to be dissected as X.29 data. - */ - localoffset += 4; - break; - - default: - /* - * The NLPID isn't part of the PDU - skip it. - * If that means there's nothing to dissect - */ - localoffset++; - } - } - } else { - /* if there's no user data in the CALL REQUEST/ - INCOMING CALL packet, it's COTP; */ + case X25_FROM_DCE: + short_name = "Inc. call"; + long_name = "Incoming call"; + break; + + case X25_FROM_DTE: + short_name = "Call req."; + long_name = "Call request"; + break; + + case X25_UNKNOWN: + short_name = "Inc. call/Call req."; + long_name = "Incoming call/Call request"; + break; + } + col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d", short_name, vc); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, + 0, 2, bytes0_1); + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, + X25_CALL_REQUEST, "%s", long_name); + } + localoffset = 3; + if (localoffset < x25_pkt_len) { /* calling/called addresses */ + if (toa) + x25_toa(x25_tree, (gint*)&localoffset, tvb, pinfo); + else + x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, FALSE); + } + + if (localoffset < x25_pkt_len) /* facilities */ + dump_facilities(x25_tree, (gint*)&localoffset, tvb, pinfo); + + if (localoffset < tvb_reported_length(tvb)) /* user data */ + { + + userdata_tree = proto_tree_add_subtree(x25_tree, tvb, localoffset, -1, + ett_x25_user_data, &ti, "User data"); + + /* X.263/ISO 9577 says that: + + When CLNP or ESIS are run over X.25, the SPI + is 0x81 or 0x82, respectively; those are the + NLPIDs for those protocol. + + When X.224/ISO 8073 COTP is run over X.25, and + when ISO 11570 explicit identification is being + used, the first octet of the user data field is + a TPDU length field, and the rest is "as defined + in ITU-T Rec. X.225 | ISO/IEC 8073, Annex B, + or ITU-T Rec. X.264 and ISO/IEC 11570". + + When X.264/ISO 11570 default identification is + being used, there is no user data field in the + CALL REQUEST packet. This is for X.225/ISO 8073 + COTP. + + It also says that SPI values from 0x03 through 0x3f are + reserved and are in use by X.224/ISO 8073 Annex B and + X.264/ISO 11570. The note says that those values are + not NLPIDs, they're "used by the respective higher layer + protocol" and "not used for higher layer protocol + identification". I infer from this and from what + X.264/ISO 11570 says that this means that values in those + range are valid values for the first octet of an + X.224/ISO 8073 packet or for X.264/ISO 11570. + + Annex B of X.225/ISO 8073 mentions some additional TPDU + types that can be put in what I presume is the user + data of connect requests. It says that: + + The sending transport entity shall: + + a) either not transmit any TPDU in the NS-user data + parameter of the N-CONNECT request primitive; or + + b) transmit the UN-TPDU (see ITU-T Rec. X.264 and + ISO/IEC 11570) followed by the NCM-TPDU in the + NS-user data parameter of the N-CONNECT request + primitive. + + I don't know if this means that the user data field + will contain a UN TPDU followed by an NCM TPDU or not. + + X.264/ISO 11570 says that: + + When default identification is being used, + X.225/ISO 8073 COTP is identified. No user data + is sent in the network-layer connection request. + + When explicit identification is being used, + the user data is a UN TPDU ("Use of network + connection TPDU"), which specifies the transport + protocol to use over this network connection. + It also says that the length of a UN TPDU shall + not exceed 32 octets, i.e. shall not exceed 0x20; + it says this is "due to the desire not to conflict + with the protocol identifier field carried by X.25 + CALL REQUEST/INCOMING CALL packets", and says that + field has values specified in X.244. X.244 has been + superseded by X.263/ISO 9577, so that presumably + means the goal is to allow a UN TPDU's length + field to be distinguished from an NLPID, allowing + you to tell whether X.264/ISO 11570 explicit + identification is being used or an NLPID is + being used as the SPI. + + I read this as meaning that, if the ISO mechanisms are + used to identify the protocol being carried over X.25: + + if there's no user data in the CALL REQUEST/ + INCOMING CALL packet, it's COTP; + + if there is user data, then: + + if the first octet is less than or equal to + 32, it might be a UN TPDU, and that identifies + the transport protocol being used, and + it may be followed by more data, such + as a COTP NCM TPDU if it's COTP; + + if the first octet is greater than 32, it's + an NLPID, *not* a TPDU length, and the + stuff following it is *not* a TPDU. + + Figure A.2 of X.263/ISO 9577 seems to say that the + first octet of the user data is a TPDU length field, + in the range 0x03 through 0x82, and says they are + for X.225/ISO 8073 Annex B or X.264/ISO 11570. + + However, X.264/ISO 11570 seems to imply that the length + field would be that of a UN TPDU, which must be less + than or equal to 0x20, and X.225/ISO 8073 Annex B seems + to indicate that the user data must begin with + an X.264/ISO 11570 UN TPDU, so I'd say that A.2 should + have said "in the range 0x03 through 0x20", instead + (the length value doesn't include the length field, + and the minimum UN TPDU has length, type, PRT-ID, + and SHARE, so that's 3 bytes without the length). */ + spi = tvb_get_guint8(tvb, localoffset); + if (spi > 32 || spi < 3) { + /* First octet is > 32, or < 3, so the user data isn't an + X.264/ISO 11570 UN TPDU */ + is_x_264 = FALSE; + } else { + /* First octet is >= 3 and <= 32, so the user data *might* + be an X.264/ISO 11570 UN TPDU. Check whether we have + enough data to see if it is. */ + if (tvb_bytes_exist(tvb, localoffset+1, 1)) { + /* We do; check whether the second octet is 1. */ + if (tvb_get_guint8(tvb, localoffset+1) == 0x01) { + /* Yes, the second byte is 1, so it looks like + a UN TPDU. */ + is_x_264 = TRUE; + } else { + /* No, the second byte is not 1, so it's not a + UN TPDU. */ + is_x_264 = FALSE; + } + } else { + /* We can't see the second byte of the putative UN + TPDU, so we don't know if that's what it is. */ + is_x_264 = -1; + } + } + if (is_x_264 == -1) { + /* + * We don't know what it is; just skip it. + */ + localoffset = tvb_length(tvb); + } else if (is_x_264) { + /* It looks like an X.264 UN TPDU, so show it as such. */ + if (userdata_tree) { + proto_tree_add_item( userdata_tree, hf_x264_length_indicator, tvb, localoffset, 1, ENC_NA); + proto_tree_add_item( userdata_tree, hf_x264_un_tpdu_id, tvb, localoffset+1, 1, ENC_NA); + } + prt_id = tvb_get_guint8(tvb, localoffset+2); + if (userdata_tree) { + proto_tree_add_item( userdata_tree, hf_x264_protocol_id, tvb, localoffset+2, 1, ENC_NA); + proto_tree_add_item( userdata_tree, hf_x264_sharing_strategy, tvb, localoffset+3, 1, ENC_NA); + } + + /* XXX - dissect the variable part? */ + + /* The length doesn't include the length octet itself. */ + localoffset += spi + 1; + + switch (prt_id) { + + case PRT_ID_ISO_8073: + /* ISO 8073 COTP */ + if (!pinfo->fd->flags.visited) + x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle); + /* XXX - dissect the rest of the user data as COTP? + That needs support for NCM TPDUs, etc. */ + break; + + case PRT_ID_ISO_8602: + /* ISO 8602 CLTP */ + if (!pinfo->fd->flags.visited) + x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle); + break; + } + } else if (is_x_264 == 0) { + /* It doesn't look like a UN TPDU, so compare the first + octet of the CALL REQUEST packet with various X.263/ + ISO 9577 NLPIDs, as per Annex A of X.263/ISO 9577. */ + + if (userdata_tree) { + proto_tree_add_item( userdata_tree, hf_x263_sec_protocol_id, tvb, localoffset, 1, ENC_NA); + } + + if (!pinfo->fd->flags.visited) { + /* + * Is there a dissector handle for this SPI? + * If so, assign it to this virtual circuit. + */ + dissect = dissector_get_uint_handle(x25_subdissector_table, spi); + if (dissect != NULL) + x25_hash_add_proto_start(vc, pinfo->fd->num, dissect); + } + + /* + * If there's only one octet of user data, it's just + * an NLPID; don't try to dissect it. + */ + if (localoffset + 1 == tvb_reported_length(tvb)) + return; + + /* + * There's more than one octet of user data, so we'll + * dissect it; for some protocols, the NLPID is considered + * to be part of the PDU, so, for those cases, we don't + * skip past it. For other protocols, we skip the NLPID. + */ + switch (spi) { + + case NLPID_ISO8473_CLNP: + case NLPID_ISO9542_ESIS: + case NLPID_ISO10589_ISIS: + case NLPID_ISO10747_IDRP: + case NLPID_SNDCF: + /* + * The NLPID is part of the PDU. Don't skip it. + * But if it's all there is to the PDU, don't + * bother dissecting it. + */ + break; + + case NLPID_SPI_X_29: + /* + * The first 4 bytes of the call user data are + * the SPI plus 3 reserved bytes; they are not + * part of the data to be dissected as X.29 data. + */ + localoffset += 4; + break; + + default: + /* + * The NLPID isn't part of the PDU - skip it. + * If that means there's nothing to dissect + */ + localoffset++; + } + } + } else { + /* if there's no user data in the CALL REQUEST/ + INCOMING CALL packet, it's COTP; */ if (call_request_nodata_is_cotp){ x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle); } - } - break; + } + break; case X25_CALL_ACCEPTED: switch (dir) { - case X25_FROM_DCE: - short_name = "Call conn."; - long_name = "Call connected"; - break; - - case X25_FROM_DTE: - short_name = "Call acc."; - long_name = "Call accepted"; - break; - - case X25_UNKNOWN: - short_name = "Call conn./Call acc."; - long_name = "Call connected/Call accepted"; - break; - } - col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d", short_name, vc); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, - X25_CALL_ACCEPTED, "%s", long_name); - } - localoffset = 3; + case X25_FROM_DCE: + short_name = "Call conn."; + long_name = "Call connected"; + break; + + case X25_FROM_DTE: + short_name = "Call acc."; + long_name = "Call accepted"; + break; + + case X25_UNKNOWN: + short_name = "Call conn./Call acc."; + long_name = "Call connected/Call accepted"; + break; + } + col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d", short_name, vc); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, + X25_CALL_ACCEPTED, "%s", long_name); + } + localoffset = 3; if (localoffset < x25_pkt_len) { /* calling/called addresses */ - if (toa) - x25_toa(x25_tree, (gint*)&localoffset, tvb, pinfo); - else - x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, FALSE); - } - - if (localoffset < x25_pkt_len) /* facilities */ - dump_facilities(x25_tree, (gint*)&localoffset, tvb, pinfo); - break; + if (toa) + x25_toa(x25_tree, (gint*)&localoffset, tvb, pinfo); + else + x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, FALSE); + } + + if (localoffset < x25_pkt_len) /* facilities */ + dump_facilities(x25_tree, (gint*)&localoffset, tvb, pinfo); + break; case X25_CLEAR_REQUEST: switch (dir) { - case X25_FROM_DCE: - short_name = "Clear ind."; - long_name = "Clear indication"; - break; - - case X25_FROM_DTE: - short_name = "Clear req."; - long_name = "Clear request"; - break; - - case X25_UNKNOWN: - short_name = "Clear ind./Clear req."; - long_name = "Clear indication/Clear request"; - break; - } - col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d %s - %s", short_name, - vc, clear_code(tvb_get_guint8(tvb, 3)), - val_to_str_ext(tvb_get_guint8(tvb, 4), &x25_clear_diag_vals_ext, "Unknown (0x%02x)")); - x25_hash_add_proto_end(vc, pinfo->fd->num); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, - localoffset+2, 1, X25_CLEAR_REQUEST, "%s", - long_name); - proto_tree_add_text(x25_tree, tvb, 3, 1, - "Cause: %s", clear_code(tvb_get_guint8(tvb, 3))); - proto_tree_add_item(x25_tree, hf_x25_diagnostic, tvb, 4, 1, ENC_NA); - } - localoffset = x25_pkt_len; - break; + case X25_FROM_DCE: + short_name = "Clear ind."; + long_name = "Clear indication"; + break; + + case X25_FROM_DTE: + short_name = "Clear req."; + long_name = "Clear request"; + break; + + case X25_UNKNOWN: + short_name = "Clear ind./Clear req."; + long_name = "Clear indication/Clear request"; + break; + } + col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d %s - %s", short_name, + vc, clear_code(tvb_get_guint8(tvb, 3)), + val_to_str_ext(tvb_get_guint8(tvb, 4), &x25_clear_diag_vals_ext, "Unknown (0x%02x)")); + x25_hash_add_proto_end(vc, pinfo->fd->num); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, + localoffset+2, 1, X25_CLEAR_REQUEST, "%s", + long_name); + proto_tree_add_text(x25_tree, tvb, 3, 1, + "Cause: %s", clear_code(tvb_get_guint8(tvb, 3))); + proto_tree_add_item(x25_tree, hf_x25_diagnostic, tvb, 4, 1, ENC_NA); + } + localoffset = x25_pkt_len; + break; case X25_CLEAR_CONFIRMATION: - col_add_fstr(pinfo->cinfo, COL_INFO, "Clear Conf. VC:%d", vc); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, - X25_CLEAR_CONFIRMATION); - } - localoffset = x25_pkt_len; - - if (localoffset < tvb_reported_length(tvb)) { /* extended clear conf format */ - if (toa) - x25_toa(x25_tree, (gint*)&localoffset, tvb, pinfo); - else - x25_ntoa(x25_tree,(gint*)&localoffset, tvb, pinfo, FALSE); - } - - if (localoffset < tvb_reported_length(tvb)) /* facilities */ - dump_facilities(x25_tree, (gint*)&localoffset, tvb, pinfo); - break; + col_add_fstr(pinfo->cinfo, COL_INFO, "Clear Conf. VC:%d", vc); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, + X25_CLEAR_CONFIRMATION); + } + localoffset = x25_pkt_len; + + if (localoffset < tvb_reported_length(tvb)) { /* extended clear conf format */ + if (toa) + x25_toa(x25_tree, (gint*)&localoffset, tvb, pinfo); + else + x25_ntoa(x25_tree,(gint*)&localoffset, tvb, pinfo, FALSE); + } + + if (localoffset < tvb_reported_length(tvb)) /* facilities */ + dump_facilities(x25_tree, (gint*)&localoffset, tvb, pinfo); + break; case X25_DIAGNOSTIC: - col_add_fstr(pinfo->cinfo, COL_INFO, "Diag. %d", - (int)tvb_get_guint8(tvb, 3)); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, - X25_DIAGNOSTIC); - proto_tree_add_text(x25_tree, tvb, 3, 1, - "Diagnostic: %d", (int)tvb_get_guint8(tvb, 3)); - } - localoffset = x25_pkt_len; - break; + col_add_fstr(pinfo->cinfo, COL_INFO, "Diag. %d", + (int)tvb_get_guint8(tvb, 3)); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, + X25_DIAGNOSTIC); + proto_tree_add_text(x25_tree, tvb, 3, 1, + "Diagnostic: %d", (int)tvb_get_guint8(tvb, 3)); + } + localoffset = x25_pkt_len; + break; case X25_INTERRUPT: - col_add_fstr(pinfo->cinfo, COL_INFO, "Interrupt VC:%d", vc); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, - X25_INTERRUPT); - } - localoffset = x25_pkt_len; - break; + col_add_fstr(pinfo->cinfo, COL_INFO, "Interrupt VC:%d", vc); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, + X25_INTERRUPT); + } + localoffset = x25_pkt_len; + break; case X25_INTERRUPT_CONFIRMATION: - col_add_fstr(pinfo->cinfo, COL_INFO, "Interrupt Conf. VC:%d", vc); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, - X25_INTERRUPT_CONFIRMATION); - } - localoffset = x25_pkt_len; - break; + col_add_fstr(pinfo->cinfo, COL_INFO, "Interrupt Conf. VC:%d", vc); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, + X25_INTERRUPT_CONFIRMATION); + } + localoffset = x25_pkt_len; + break; case X25_RESET_REQUEST: switch (dir) { - case X25_FROM_DCE: - short_name = "Reset ind."; - long_name = "Reset indication"; - break; - - case X25_FROM_DTE: - short_name = "Reset req."; - long_name = "Reset request"; - break; - - case X25_UNKNOWN: - short_name = "Reset ind./Reset req."; - long_name = "Reset indication/Reset request"; - break; - } - col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d %s - Diag.:%d", - short_name, vc, reset_code(tvb_get_guint8(tvb, 3)), - (int)tvb_get_guint8(tvb, 4)); - x25_hash_add_proto_end(vc, pinfo->fd->num); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, - X25_RESET_REQUEST, "%s", long_name); - proto_tree_add_text(x25_tree, tvb, 3, 1, - "Cause: %s", reset_code(tvb_get_guint8(tvb, 3))); - proto_tree_add_text(x25_tree, tvb, 4, 1, - "Diagnostic: %d", (int)tvb_get_guint8(tvb, 4)); - } - localoffset = x25_pkt_len; - break; + case X25_FROM_DCE: + short_name = "Reset ind."; + long_name = "Reset indication"; + break; + + case X25_FROM_DTE: + short_name = "Reset req."; + long_name = "Reset request"; + break; + + case X25_UNKNOWN: + short_name = "Reset ind./Reset req."; + long_name = "Reset indication/Reset request"; + break; + } + col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d %s - Diag.:%d", + short_name, vc, reset_code(tvb_get_guint8(tvb, 3)), + (int)tvb_get_guint8(tvb, 4)); + x25_hash_add_proto_end(vc, pinfo->fd->num); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, + X25_RESET_REQUEST, "%s", long_name); + proto_tree_add_text(x25_tree, tvb, 3, 1, + "Cause: %s", reset_code(tvb_get_guint8(tvb, 3))); + proto_tree_add_text(x25_tree, tvb, 4, 1, + "Diagnostic: %d", (int)tvb_get_guint8(tvb, 4)); + } + localoffset = x25_pkt_len; + break; case X25_RESET_CONFIRMATION: - col_add_fstr(pinfo->cinfo, COL_INFO, "Reset conf. VC:%d", vc); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, - X25_RESET_CONFIRMATION); - } - localoffset = x25_pkt_len; - break; - case X25_RESTART_REQUEST: + col_add_fstr(pinfo->cinfo, COL_INFO, "Reset conf. VC:%d", vc); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, + X25_RESET_CONFIRMATION); + } + localoffset = x25_pkt_len; + break; + case X25_RESTART_REQUEST: switch (dir) { - case X25_FROM_DCE: - short_name = "Restart ind."; - long_name = "Restart indication"; - break; - - case X25_FROM_DTE: - short_name = "Restart req."; - long_name = "Restart request"; - break; - - case X25_UNKNOWN: - short_name = "Restart ind./Restart req."; - long_name = "Restart indication/Restart request"; - break; - } - col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s - Diag.:%d", - short_name, - restart_code(tvb_get_guint8(tvb, 3)), - (int)tvb_get_guint8(tvb, 4)); - if (x25_tree) { - proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, - X25_RESTART_REQUEST, "%s", long_name); - proto_tree_add_text(x25_tree, tvb, 3, 1, - "Cause: %s", restart_code(tvb_get_guint8(tvb, 3))); - proto_tree_add_text(x25_tree, tvb, 4, 1, - "Diagnostic: %d", (int)tvb_get_guint8(tvb, 4)); - } - localoffset = x25_pkt_len; - break; + case X25_FROM_DCE: + short_name = "Restart ind."; + long_name = "Restart indication"; + break; + + case X25_FROM_DTE: + short_name = "Restart req."; + long_name = "Restart request"; + break; + + case X25_UNKNOWN: + short_name = "Restart ind./Restart req."; + long_name = "Restart indication/Restart request"; + break; + } + col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s - Diag.:%d", + short_name, + restart_code(tvb_get_guint8(tvb, 3)), + (int)tvb_get_guint8(tvb, 4)); + if (x25_tree) { + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, + X25_RESTART_REQUEST, "%s", long_name); + proto_tree_add_text(x25_tree, tvb, 3, 1, + "Cause: %s", restart_code(tvb_get_guint8(tvb, 3))); + proto_tree_add_text(x25_tree, tvb, 4, 1, + "Diagnostic: %d", (int)tvb_get_guint8(tvb, 4)); + } + localoffset = x25_pkt_len; + break; case X25_RESTART_CONFIRMATION: - col_set_str(pinfo->cinfo, COL_INFO, "Restart conf."); - if (x25_tree) - proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, - X25_RESTART_CONFIRMATION); - localoffset = x25_pkt_len; - break; + col_set_str(pinfo->cinfo, COL_INFO, "Restart conf."); + if (x25_tree) + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, + X25_RESTART_CONFIRMATION); + localoffset = x25_pkt_len; + break; case X25_REGISTRATION_REQUEST: - col_set_str(pinfo->cinfo, COL_INFO, "Registration req."); - if (x25_tree) - proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, - X25_REGISTRATION_REQUEST); - localoffset = 3; - if (localoffset < x25_pkt_len) - x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, TRUE); - - if (x25_tree) { - if (localoffset < x25_pkt_len) - proto_tree_add_item( x25_tree, hf_x25_reg_request_length, tvb, localoffset, 1, ENC_NA); - if (localoffset+1 < x25_pkt_len) - proto_tree_add_text(x25_tree, tvb, localoffset+1, - tvb_get_guint8(tvb, localoffset) & 0x7F, - "Registration"); - } - localoffset = tvb_reported_length(tvb); - break; + col_set_str(pinfo->cinfo, COL_INFO, "Registration req."); + if (x25_tree) + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, + X25_REGISTRATION_REQUEST); + localoffset = 3; + if (localoffset < x25_pkt_len) + x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, TRUE); + + if (x25_tree) { + if (localoffset < x25_pkt_len) + proto_tree_add_item( x25_tree, hf_x25_reg_request_length, tvb, localoffset, 1, ENC_NA); + if (localoffset+1 < x25_pkt_len) + proto_tree_add_text(x25_tree, tvb, localoffset+1, + tvb_get_guint8(tvb, localoffset) & 0x7F, + "Registration"); + } + localoffset = tvb_reported_length(tvb); + break; case X25_REGISTRATION_CONFIRMATION: - col_set_str(pinfo->cinfo, COL_INFO, "Registration conf."); - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, - X25_REGISTRATION_CONFIRMATION); - proto_tree_add_item(x25_tree, hf_x25_reg_confirm_cause, tvb, 3, 1, ENC_NA); - proto_tree_add_item(x25_tree, hf_x25_reg_confirm_diagnostic, tvb, 4, 1, ENC_NA); - } - localoffset = 5; - if (localoffset < x25_pkt_len) - x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, TRUE); - - if (x25_tree) { - if (localoffset < x25_pkt_len) - proto_tree_add_item( x25_tree, hf_x25_reg_confirm_length, tvb, localoffset, 1, ENC_NA); - if (localoffset+1 < x25_pkt_len) - proto_tree_add_text(x25_tree, tvb, localoffset+1, - tvb_get_guint8(tvb, localoffset) & 0x7F, - "Registration"); - } - localoffset = tvb_reported_length(tvb); - break; + col_set_str(pinfo->cinfo, COL_INFO, "Registration conf."); + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1, + X25_REGISTRATION_CONFIRMATION); + proto_tree_add_item(x25_tree, hf_x25_reg_confirm_cause, tvb, 3, 1, ENC_NA); + proto_tree_add_item(x25_tree, hf_x25_reg_confirm_diagnostic, tvb, 4, 1, ENC_NA); + } + localoffset = 5; + if (localoffset < x25_pkt_len) + x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, TRUE); + + if (x25_tree) { + if (localoffset < x25_pkt_len) + proto_tree_add_item( x25_tree, hf_x25_reg_confirm_length, tvb, localoffset, 1, ENC_NA); + if (localoffset+1 < x25_pkt_len) + proto_tree_add_text(x25_tree, tvb, localoffset+1, + tvb_get_guint8(tvb, localoffset) & 0x7F, + "Registration"); + } + localoffset = tvb_reported_length(tvb); + break; default: - localoffset = 2; - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, localoffset-2, - 2, bytes0_1); - } - if (PACKET_IS_DATA(pkt_type)) { - if (modulo == 8) - col_add_fstr(pinfo->cinfo, COL_INFO, - "Data VC:%d P(S):%d P(R):%d %s", vc, - (pkt_type >> 1) & 0x07, - (pkt_type >> 5) & 0x07, - (pkt_type & X25_MBIT_MOD8) ? " M" : ""); - else - col_add_fstr(pinfo->cinfo, COL_INFO, - "Data VC:%d P(S):%d P(R):%d %s", vc, - tvb_get_guint8(tvb, localoffset+1) >> 1, - pkt_type >> 1, - (tvb_get_guint8(tvb, localoffset+1) & X25_MBIT_MOD128) ? " M" : ""); - if (x25_tree) { - if (modulo == 8) { - proto_tree_add_uint(x25_tree, hf_x25_p_r_mod8, tvb, - localoffset, 1, pkt_type); - proto_tree_add_boolean(x25_tree, hf_x25_mbit_mod8, tvb, - localoffset, 1, pkt_type); - proto_tree_add_uint(x25_tree, hf_x25_p_s_mod8, tvb, - localoffset, 1, pkt_type); - proto_tree_add_uint(x25_tree, hf_x25_type_data, tvb, - localoffset, 1, pkt_type); - } - else { - proto_tree_add_uint(x25_tree, hf_x25_p_r_mod128, tvb, - localoffset, 1, pkt_type); - proto_tree_add_uint(x25_tree, hf_x25_type_data, tvb, - localoffset, 1, pkt_type); - proto_tree_add_uint(x25_tree, hf_x25_p_s_mod128, tvb, - localoffset+1, 1, - tvb_get_guint8(tvb, localoffset+1)); - proto_tree_add_boolean(x25_tree, hf_x25_mbit_mod128, tvb, - localoffset+1, 1, - tvb_get_guint8(tvb, localoffset+1)); - } - } - if (modulo == 8) { - m_bit_set = pkt_type & X25_MBIT_MOD8; - localoffset += 1; - } else { - m_bit_set = tvb_get_guint8(tvb, localoffset+1) & X25_MBIT_MOD128; - localoffset += 2; - } - payload_len = tvb_reported_length_remaining(tvb, localoffset); - if (reassemble_x25) { - /* - * Reassemble received and sent traffic separately. - * We don't reassemble traffic with an unknown direction - * at all. - */ - frag_key = vc; - if (side) { - /* - * OR in an extra bit to distinguish from traffic - * in the other direction. - */ - frag_key |= 0x10000; - } - fd_head = fragment_add_seq_next(&x25_reassembly_table, - tvb, localoffset, - pinfo, frag_key, NULL, - payload_len, m_bit_set); - pinfo->fragmented = m_bit_set; + localoffset = 2; + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, localoffset-2, + 2, bytes0_1); + } + if (PACKET_IS_DATA(pkt_type)) { + if (modulo == 8) + col_add_fstr(pinfo->cinfo, COL_INFO, + "Data VC:%d P(S):%d P(R):%d %s", vc, + (pkt_type >> 1) & 0x07, + (pkt_type >> 5) & 0x07, + (pkt_type & X25_MBIT_MOD8) ? " M" : ""); + else + col_add_fstr(pinfo->cinfo, COL_INFO, + "Data VC:%d P(S):%d P(R):%d %s", vc, + tvb_get_guint8(tvb, localoffset+1) >> 1, + pkt_type >> 1, + (tvb_get_guint8(tvb, localoffset+1) & X25_MBIT_MOD128) ? " M" : ""); + if (x25_tree) { + if (modulo == 8) { + proto_tree_add_uint(x25_tree, hf_x25_p_r_mod8, tvb, + localoffset, 1, pkt_type); + proto_tree_add_boolean(x25_tree, hf_x25_mbit_mod8, tvb, + localoffset, 1, pkt_type); + proto_tree_add_uint(x25_tree, hf_x25_p_s_mod8, tvb, + localoffset, 1, pkt_type); + proto_tree_add_uint(x25_tree, hf_x25_type_data, tvb, + localoffset, 1, pkt_type); + } + else { + proto_tree_add_uint(x25_tree, hf_x25_p_r_mod128, tvb, + localoffset, 1, pkt_type); + proto_tree_add_uint(x25_tree, hf_x25_type_data, tvb, + localoffset, 1, pkt_type); + proto_tree_add_uint(x25_tree, hf_x25_p_s_mod128, tvb, + localoffset+1, 1, + tvb_get_guint8(tvb, localoffset+1)); + proto_tree_add_boolean(x25_tree, hf_x25_mbit_mod128, tvb, + localoffset+1, 1, + tvb_get_guint8(tvb, localoffset+1)); + } + } + if (modulo == 8) { + m_bit_set = pkt_type & X25_MBIT_MOD8; + localoffset += 1; + } else { + m_bit_set = tvb_get_guint8(tvb, localoffset+1) & X25_MBIT_MOD128; + localoffset += 2; + } + payload_len = tvb_reported_length_remaining(tvb, localoffset); + if (reassemble_x25) { + /* + * Reassemble received and sent traffic separately. + * We don't reassemble traffic with an unknown direction + * at all. + */ + frag_key = vc; + if (side) { + /* + * OR in an extra bit to distinguish from traffic + * in the other direction. + */ + frag_key |= 0x10000; + } + fd_head = fragment_add_seq_next(&x25_reassembly_table, + tvb, localoffset, + pinfo, frag_key, NULL, + payload_len, m_bit_set); + pinfo->fragmented = m_bit_set; /* Fragment handling is not adapted to handle several x25 * packets in the same frame. This is common with XOT and @@ -1952,62 +1952,62 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * Therefore, fragment_add_seq_next seem to always return fd_head * A fix to use m_bit_set to only show fragments for last pkt */ - if (!m_bit_set && fd_head) { - if (fd_head->next) { - proto_item *frag_tree_item; + if (!m_bit_set && fd_head) { + if (fd_head->next) { + proto_item *frag_tree_item; - /* This is the last packet */ - next_tvb = tvb_new_chain(tvb, fd_head->tvb_data); - add_new_data_source(pinfo, next_tvb, "Reassembled X.25"); + /* This is the last packet */ + next_tvb = tvb_new_chain(tvb, fd_head->tvb_data); + add_new_data_source(pinfo, next_tvb, "Reassembled X.25"); if (x25_tree) { show_fragment_seq_tree(fd_head, &x25_frag_items, x25_tree, pinfo, next_tvb, &frag_tree_item); } - } - } - - if (m_bit_set && next_tvb == NULL) { - /* - * This isn't the last packet, so just - * show it as X.25 user data. - */ - proto_tree_add_text(x25_tree, tvb, localoffset, -1, - "User data (%u byte%s)", payload_len, - plurality(payload_len, "", "s")); - return; - } - } - } else { - /* - * Non-data packets (RR, RNR, REJ). - */ - if (modulo == 8) { - if (x25_tree) { - proto_tree_add_uint(x25_tree, hf_x25_p_r_mod8, tvb, - localoffset, 1, pkt_type); - proto_tree_add_item(x25_tree, hf_x25_type_fc_mod8, tvb, - localoffset, 1, ENC_NA); - } - col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d P(R):%d", - val_to_str(PACKET_TYPE_FC(pkt_type), vals_x25_type, "Unknown (0x%02X)"), - vc, (pkt_type >> 5) & 0x07); - localoffset += 1; - } else { - if (x25_tree) { - proto_tree_add_item(x25_tree, hf_x25_type, tvb, - localoffset, 1, ENC_NA); - proto_tree_add_item(x25_tree, hf_x25_p_r_mod128, tvb, - localoffset+1, 1, ENC_NA); - } - col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d P(R):%d", - val_to_str(PACKET_TYPE_FC(pkt_type), vals_x25_type, "Unknown (0x%02X)"), - vc, tvb_get_guint8(tvb, localoffset+1) >> 1); - localoffset += 2; - } - } - break; + } + } + + if (m_bit_set && next_tvb == NULL) { + /* + * This isn't the last packet, so just + * show it as X.25 user data. + */ + proto_tree_add_text(x25_tree, tvb, localoffset, -1, + "User data (%u byte%s)", payload_len, + plurality(payload_len, "", "s")); + return; + } + } + } else { + /* + * Non-data packets (RR, RNR, REJ). + */ + if (modulo == 8) { + if (x25_tree) { + proto_tree_add_uint(x25_tree, hf_x25_p_r_mod8, tvb, + localoffset, 1, pkt_type); + proto_tree_add_item(x25_tree, hf_x25_type_fc_mod8, tvb, + localoffset, 1, ENC_NA); + } + col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d P(R):%d", + val_to_str(PACKET_TYPE_FC(pkt_type), vals_x25_type, "Unknown (0x%02X)"), + vc, (pkt_type >> 5) & 0x07); + localoffset += 1; + } else { + if (x25_tree) { + proto_tree_add_item(x25_tree, hf_x25_type, tvb, + localoffset, 1, ENC_NA); + proto_tree_add_item(x25_tree, hf_x25_p_r_mod128, tvb, + localoffset+1, 1, ENC_NA); + } + col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d P(R):%d", + val_to_str(PACKET_TYPE_FC(pkt_type), vals_x25_type, "Unknown (0x%02X)"), + vc, tvb_get_guint8(tvb, localoffset+1) >> 1); + localoffset += 2; + } + } + break; } if (localoffset >= tvb_reported_length(tvb)) @@ -2020,17 +2020,17 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* See if there's already a dissector for this circuit. */ if (try_circuit_dissector(CT_X25, vc, pinfo->fd->num, next_tvb, pinfo, - tree, &q_bit_set)) { - return; /* found it and dissected it */ + tree, &q_bit_set)) { + return; /* found it and dissected it */ } /* Did the user suggest QLLC/SNA? */ if (payload_is_qllc_sna) { - /* Yes - dissect it as QLLC/SNA. */ - if (!pinfo->fd->flags.visited) - x25_hash_add_proto_start(vc, pinfo->fd->num, qllc_handle); - call_dissector_with_data(qllc_handle, next_tvb, pinfo, tree, &q_bit_set); - return; + /* Yes - dissect it as QLLC/SNA. */ + if (!pinfo->fd->flags.visited) + x25_hash_add_proto_start(vc, pinfo->fd->num, qllc_handle); + call_dissector_with_data(qllc_handle, next_tvb, pinfo, tree, &q_bit_set); + return; } if (payload_check_data){ @@ -2039,11 +2039,11 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (tvb_get_guint8(tvb, localoffset) == tvb_length(next_tvb)-1) { /* First byte contains the length of the remaining buffer */ if ((tvb_get_guint8(tvb, localoffset+1) & 0x0F) == 0) { - /* Second byte contains a valid COTP TPDU */ - if (!pinfo->fd->flags.visited) - x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle); - call_dissector(ositp_handle, next_tvb, pinfo, tree); - return; + /* Second byte contains a valid COTP TPDU */ + if (!pinfo->fd->flags.visited) + x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle); + call_dissector(ositp_handle, next_tvb, pinfo, tree); + return; } } @@ -2052,24 +2052,24 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, switch (tvb_get_guint8(tvb, localoffset)) { case 0x45: - /* Looks like an IP header */ - if (!pinfo->fd->flags.visited) - x25_hash_add_proto_start(vc, pinfo->fd->num, ip_handle); - call_dissector(ip_handle, next_tvb, pinfo, tree); - return; + /* Looks like an IP header */ + if (!pinfo->fd->flags.visited) + x25_hash_add_proto_start(vc, pinfo->fd->num, ip_handle); + call_dissector(ip_handle, next_tvb, pinfo, tree); + return; case NLPID_ISO8473_CLNP: - if (!pinfo->fd->flags.visited) - x25_hash_add_proto_start(vc, pinfo->fd->num, clnp_handle); - call_dissector(clnp_handle, next_tvb, pinfo, tree); - return; + if (!pinfo->fd->flags.visited) + x25_hash_add_proto_start(vc, pinfo->fd->num, clnp_handle); + call_dissector(clnp_handle, next_tvb, pinfo, tree); + return; } } /* Try the heuristic dissectors. */ if (dissector_try_heuristic(x25_heur_subdissector_list, next_tvb, pinfo, - tree, &hdtbl_entry, NULL)) { - return; + tree, &hdtbl_entry, NULL)) { + return; } /* All else failed; dissect it as raw data */ @@ -2084,9 +2084,9 @@ static void dissect_x25_dir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { dissect_x25_common(tvb, pinfo, tree, - (pinfo->pseudo_header->x25.flags & FROM_DCE) ? X25_FROM_DCE : - X25_FROM_DTE, - pinfo->pseudo_header->x25.flags & FROM_DCE); + (pinfo->pseudo_header->x25.flags & FROM_DCE) ? X25_FROM_DCE : + X25_FROM_DTE, + pinfo->pseudo_header->x25.flags & FROM_DCE); } /* @@ -2106,311 +2106,311 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ direction = CMP_ADDRESS(&pinfo->src, &pinfo->dst); if (direction == 0) - direction = (pinfo->srcport > pinfo->destport)*2 - 1; + direction = (pinfo->srcport > pinfo->destport)*2 - 1; dissect_x25_common(tvb, pinfo, tree, X25_UNKNOWN, direction > 0); } static void x25_reassemble_init(void) { - reassembly_table_init(&x25_reassembly_table, - &addresses_reassembly_table_functions); + reassembly_table_init(&x25_reassembly_table, + &addresses_reassembly_table_functions); } void proto_register_x25(void) { static hf_register_info hf[] = { - { &hf_x25_facility, - { "Facility", "x25.facility", FT_NONE, BASE_NONE, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facilities_length, - { "Facilities Length", "x25.facilities_length", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_length, - { "Length", "x25.facility_length", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_class, - { "Facility Class", "x25.facility.class", FT_UINT8, BASE_HEX, VALS(x25_facilities_class_vals), X25_FAC_CLASS_MASK, - NULL, HFILL }}, - { &hf_x25_facility_classA, - { "Code", "x25.facility.classA", FT_UINT8, BASE_HEX, VALS(x25_facilities_classA_vals), 0, - "Facility ClassA Code", HFILL }}, - { &hf_x25_facility_classA_comp_mark, - { "Parameter", "x25.facility.comp_mark", FT_UINT8, BASE_DEC, VALS(x25_facilities_classA_comp_mark_vals), 0, - "Facility Marker Parameter", HFILL }}, - { &hf_x25_facility_classA_reverse, - { "Parameter", "x25.facility.reverse", FT_UINT8, BASE_HEX, NULL, 0, - "Facility Reverse Charging Parameter", HFILL }}, - { &hf_x25_facility_classA_charging_info, - { "Parameter", "x25.facility.charging_info", FT_UINT8, BASE_HEX, NULL, 0, - "Facility Charging Information Parameter", HFILL }}, - { &hf_x25_facility_reverse_charging, - { "Reverse charging", "x25.reverse_charging", FT_BOOLEAN, 8, TFS(&x25_reverse_charging_val), 0x01, - NULL, HFILL }}, - { &hf_x25_facility_charging_info, - { "Charging information", "x25.charging_info", FT_BOOLEAN, 8, TFS(&tfs_requested_not_requested), 0x01, - NULL, HFILL }}, - { &hf_x25_facility_throughput_called_dte, - { "From the called DTE", "x25.facility.throughput.called_dte", FT_UINT8, BASE_DEC, VALS(x25_facilities_classA_throughput_vals), 0xF0, - "Facility Throughput called DTE", HFILL }}, - { &hf_x25_throughput_called_dte, - { "From the calling DTE", "x25.facility.throughput.called_dte", FT_UINT8, BASE_DEC, VALS(x25_facilities_classA_throughput_vals), 0x0F, - "Facility Throughput called DTE", HFILL }}, - { &hf_x25_facility_classA_cug, - { "Closed user group", "x25.facility.cug", FT_UINT8, BASE_HEX, NULL, 0, - "Facility Closed user group", HFILL }}, - { &hf_x25_facility_classA_called_motif, - { "Parameter", "x25.facility.called_motif", FT_UINT8, BASE_HEX, NULL, 0, - "Facility Called address modified parameter", HFILL }}, - { &hf_x25_facility_classA_cug_outgoing_acc, - { "Closed user group", "x25.facility.cug_outgoing_acc", FT_UINT8, BASE_HEX, NULL, 0, - "Facility Closed user group with outgoing access selection", HFILL }}, - { &hf_x25_facility_classA_throughput_min, - { "Parameter", "x25.facility.throughput_min", FT_UINT8, BASE_HEX, NULL, 0, - "Facility Minimum throughput class parameter", HFILL }}, - { &hf_x25_facility_classA_express_data, - { "Parameter", "x25.facility.express_data", FT_UINT8, BASE_HEX, NULL, 0, - "Facility Negotiation of express data parameter", HFILL }}, - { &hf_x25_facility_classA_unknown, - { "Parameter", "x25.facility.classA_unknown", FT_UINT8, BASE_HEX, NULL, 0, - "Facility Class A unknown parameter", HFILL }}, - { &hf_x25_facility_classB, - { "Code", "x25.facility.classB", FT_UINT8, BASE_HEX, VALS(x25_facilities_classB_vals), 0, - "Facility ClassB Code", HFILL }}, - { &hf_x25_facility_classB_bilateral_cug, - { "Bilateral CUG", "x25.facility.bilateral_cug", FT_UINT16, BASE_HEX, NULL, 0, - "Facility Bilateral CUG", HFILL }}, - { &hf_x25_facility_packet_size_called_dte, - { "From the called DTE", "x25.facility.packet_size.called_dte", FT_UINT8, BASE_DEC, VALS(x25_facilities_classB_packet_size_vals), 0, - "Facility Packet size from the called DTE", HFILL }}, - { &hf_x25_facility_packet_size_calling_dte, - { "From the calling DTE", "x25.facility.packet_size.calling_dte", FT_UINT8, BASE_DEC, VALS(x25_facilities_classB_packet_size_vals), 0, - "Facility Packet size from the calling DTE", HFILL }}, - { &hf_x25_facility_data_network_id_code, - { "Data network identification code", "x25.facility.data_network_id_code", FT_UINT16, BASE_HEX, NULL, 0, - "Facility RPOA selection data network identification code", HFILL }}, - { &hf_x25_facility_cug_ext, - { "Closed user group", "x25.facility.cug_ext", FT_UINT16, BASE_HEX, NULL, 0, - "Facility Extended closed user group selection", HFILL }}, - { &hf_x25_facility_cug_outgoing_acc_ext, - { "Closed user group", "x25.facility.cug_outgoing_acc_ext", FT_UINT16, BASE_HEX, NULL, 0, - "Facility Extended closed user group with outgoing access selection", HFILL }}, - { &hf_x25_facility_transit_delay, - { "Transit delay (ms)", "x25.facility.transit_delay", FT_UINT16, BASE_DEC, NULL, 0, - "Facility Transit delay selection and indication", HFILL }}, - { &hf_x25_facility_classB_unknown, - { "Parameter", "x25.facility.classB_unknown", FT_UINT16, BASE_HEX, NULL, 0, - "Facility Class B unknown parameter", HFILL }}, - { &hf_x25_facility_classC_unknown, - { "Parameter", "x25.facility.classC_unknown", FT_UINT24, BASE_HEX, NULL, 0, - "Facility Class C unknown parameter", HFILL }}, - { &hf_x25_facility_classC, - { "Code", "x25.facility.classC", FT_UINT8, BASE_HEX, VALS(x25_facilities_classC_vals), 0, - "Facility ClassC Code", HFILL }}, - { &hf_x25_facility_classD, - { "Code", "x25.facility.classD", FT_UINT8, BASE_HEX, VALS(x25_facilities_classD_vals), 0, - "Facility ClassD Code", HFILL }}, - { &hf_x25_gfi, - { "GFI", "x25.gfi", FT_UINT16, BASE_DEC, NULL, 0xF000, - "General format identifier", HFILL }}, - { &hf_x25_abit, - { "A Bit", "x25.a", FT_BOOLEAN, 16, NULL, X25_ABIT, - "Address Bit", HFILL }}, - { &hf_x25_qbit, - { "Q Bit", "x25.q", FT_BOOLEAN, 16, NULL, X25_QBIT, - "Qualifier Bit", HFILL }}, - { &hf_x25_dbit, - { "D Bit", "x25.d", FT_BOOLEAN, 16, NULL, X25_DBIT, - "Delivery Confirmation Bit", HFILL }}, - { &hf_x25_mod, - { "Modulo", "x25.mod", FT_UINT16, BASE_DEC, VALS(vals_modulo), 0x3000, - "Specifies whether the frame is modulo 8 or 128", HFILL }}, - { &hf_x25_lcn, - { "Logical Channel", "x25.lcn", FT_UINT16, BASE_DEC, NULL, 0x0FFF, - "Logical Channel Number", HFILL }}, - { &hf_x25_type, - { "Packet Type", "x25.type", FT_UINT8, BASE_HEX, VALS(vals_x25_type), 0x0, - NULL, HFILL }}, - { &hf_x25_type_fc_mod8, - { "Packet Type", "x25.type", FT_UINT8, BASE_HEX, VALS(vals_x25_type), 0x1F, - NULL, HFILL }}, - { &hf_x25_type_data, - { "Packet Type", "x25.type", FT_UINT8, BASE_HEX, VALS(vals_x25_type), 0x01, - NULL, HFILL }}, - { &hf_x25_diagnostic, - { "Diagnostic", "x25.diagnostic", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &x25_clear_diag_vals_ext, 0, - NULL, HFILL }}, - { &hf_x25_p_r_mod8, - { "P(R)", "x25.p_r", FT_UINT8, BASE_DEC, NULL, 0xE0, - "Packet Receive Sequence Number", HFILL }}, - { &hf_x25_p_r_mod128, - { "P(R)", "x25.p_r", FT_UINT8, BASE_DEC, NULL, 0xFE, - "Packet Receive Sequence Number", HFILL }}, - { &hf_x25_mbit_mod8, - { "M Bit", "x25.m", FT_BOOLEAN, 8, TFS(&m_bit_tfs), X25_MBIT_MOD8, - "More Bit", HFILL }}, - { &hf_x25_mbit_mod128, - { "M Bit", "x25.m", FT_BOOLEAN, 8, TFS(&m_bit_tfs), X25_MBIT_MOD128, - "More Bit", HFILL }}, - { &hf_x25_p_s_mod8, - { "P(S)", "x25.p_s", FT_UINT8, BASE_DEC, NULL, 0x0E, - "Packet Send Sequence Number", HFILL }}, - { &hf_x25_p_s_mod128, - { "P(S)", "x25.p_s", FT_UINT8, BASE_DEC, NULL, 0xFE, - "Packet Send Sequence Number", HFILL }}, - { &hf_x25_window_size_called_dte, - { "From the called DTE", "x25.window_size.called_dte", FT_UINT8, BASE_DEC, NULL, 0x7F, - NULL, HFILL }}, - { &hf_x25_window_size_calling_dte, - { "From the calling DTE", "x25.window_size.calling_dte", FT_UINT8, BASE_DEC, NULL, 0x7F, - NULL, HFILL }}, - { &hf_x25_dte_address_length, - { "DTE address length", "x25.dte_address_length", FT_UINT8, BASE_DEC, NULL, 0xF0, - NULL, HFILL }}, - { &hf_x25_dce_address_length, - { "DCE address length", "x25.dce_address_length", FT_UINT8, BASE_DEC, NULL, 0x0F, - NULL, HFILL }}, - { &hf_x25_calling_address_length, - { "Calling address length", "x25.calling_address_length", FT_UINT8, BASE_DEC, NULL, 0xF0, - NULL, HFILL }}, - { &hf_x25_called_address_length, - { "Called address length", "x25.called_address_length", FT_UINT8, BASE_DEC, NULL, 0x0F, - NULL, HFILL }}, - { &hf_x25_facility_call_transfer_reason, - { "Reason", "x25.facility.call_transfer_reason", FT_UINT8, BASE_DEC, VALS(x25_facilities_call_transfer_reason_vals), 0, - NULL, HFILL }}, - { &hf_x25_facility_monetary_unit, - { "Monetary unit", "x25.facility.monetary_unit", FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_nui, - { "NUI", "x25.facility.nui", FT_BYTES, BASE_NONE, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_cumulative_ete_transit_delay, - { "Cumulative end-to-end transit delay (ms)", "x25.facility.cumulative_ete_transit_delay", FT_UINT16, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_requested_ete_transit_delay, - { "Requested end-to-end transit delay (ms)", "x25.facility.requested_ete_transit_delay", FT_UINT16, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_max_acceptable_ete_transit_delay, - { "Maximum acceptable end-to-end transit delay (ms)", "x25.facility.mac_acceptable_ete_transit_delay", FT_UINT16, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_priority_data, - { "Priority for data", "x25.facility.priority_data", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_priority_estab_conn, - { "Priority for establishing connection", "x25.facility.priority_estab_conn", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_priority_keep_conn, - { "Priority for keeping connection", "x25.facility.priority_keep_conn", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_min_acceptable_priority_data, - { "Minimum acceptable priority for data", "x25.facility.min_acceptable_priority_data", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_min_acceptable_priority_estab_conn, - { "Minimum acceptable priority for establishing connection", "x25.facility.min_acceptable_priority_estab_conn", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_min_acceptable_priority_keep_conn, - { "Minimum acceptable priority for keeping connection", "x25.facility.min_acceptable_priority_keep_conn", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_classD_unknown, - { "Parameter", "x25.facility.classD_unknown", FT_BYTES, BASE_NONE, NULL, 0, - "Facility Class D unknown parameter", HFILL }}, - { &hf_x25_facility_call_transfer_num_semi_octets, - { "Number of semi-octets in DTE address", "x25.facility.call_transfer_num_semi_octets", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_calling_addr_ext_num_semi_octets, - { "Number of semi-octets in DTE address", "x25.facility.calling_addr_ext_num_semi_octets", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_called_addr_ext_num_semi_octets, - { "Number of semi-octets in DTE address", "x25.facility.called_addr_ext_num_semi_octets", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x25_facility_call_deflect_num_semi_octets, - { "Number of semi-octets in the alternative DTE address", "x25.facility.call_deflect_num_semi_octets", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x264_length_indicator, - { "X.264 length indicator", "x25.x264_length_indicator", FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_x264_un_tpdu_id, - { "X.264 UN TPDU identifier", "x25.x264_un_tpdu_id", FT_UINT8, BASE_HEX, NULL, 0, - NULL, HFILL }}, - { &hf_x264_protocol_id, - { "X.264 protocol identifier", "x25.x264_protocol_id", FT_UINT8, BASE_HEX, VALS(prt_id_vals), 0, - NULL, HFILL }}, - { &hf_x264_sharing_strategy, - { "X.264 sharing strategy", "x25.x264_sharing_strategy", FT_UINT8, BASE_HEX, VALS(sharing_strategy_vals), 0, - NULL, HFILL }}, - { &hf_x263_sec_protocol_id, - { "X.263 secondary protocol ID", "x25.x263_sec_protocol_id", FT_UINT8, BASE_HEX, VALS(nlpid_vals), 0, - NULL, HFILL }}, - { &hf_x25_reg_request_length, - { "Registration length", "x25.reg_request_length", FT_UINT8, BASE_DEC, NULL, 0x7F, - NULL, HFILL }}, - { &hf_x25_reg_confirm_length, - { "Registration length", "x25.reg_confirm_length", FT_UINT8, BASE_DEC, NULL, 0x7F, - NULL, HFILL }}, - - { &hf_x25_segment_overlap, - { "Fragment overlap", "x25.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Fragment overlaps with other fragments", HFILL }}, - - { &hf_x25_segment_overlap_conflict, - { "Conflicting data in fragment overlap", "x25.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Overlapping fragments contained conflicting data", HFILL }}, - - { &hf_x25_segment_multiple_tails, - { "Multiple tail fragments found", "x25.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Several tails were found when defragmenting the packet", HFILL }}, - - { &hf_x25_segment_too_long_segment, - { "Fragment too long", "x25.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, - "Fragment contained data past end of packet", HFILL }}, - - { &hf_x25_segment_error, - { "Defragmentation error", "x25.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, - "Defragmentation error due to illegal fragments", HFILL }}, - - { &hf_x25_segment_count, - { "Fragment count", "x25.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - - { &hf_x25_reassembled_length, - { "Reassembled X.25 length", "x25.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, - "The total length of the reassembled payload", HFILL }}, - - { &hf_x25_segment, - { "X.25 Fragment", "x25.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, - "X25 Fragment", HFILL }}, - - { &hf_x25_segments, - { "X.25 Fragments", "x25.fragments", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - - { &hf_x25_fast_select, - { "Fast select", "x25.fast_select", FT_UINT8, BASE_DEC, VALS(x25_fast_select_vals), 0xC0, - NULL, HFILL }}, - - { &hf_x25_icrd, - { "ICRD", "x25.icrd", FT_UINT8, BASE_DEC, VALS(x25_icrd_vals), 0x30, - NULL, HFILL }}, - - { &hf_x25_reg_confirm_cause, - { "Cause", "x25.reg_confirm.cause", FT_UINT8, BASE_DEC, VALS(x25_registration_code_vals), 0, - NULL, HFILL }}, - - { &hf_x25_reg_confirm_diagnostic, - { "Diagnostic", "x25.reg_confirm.diagnostic", FT_UINT8, BASE_DEC, VALS(x25_registration_code_vals), 0, - NULL, HFILL }}, + { &hf_x25_facility, + { "Facility", "x25.facility", FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facilities_length, + { "Facilities Length", "x25.facilities_length", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_length, + { "Length", "x25.facility_length", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_class, + { "Facility Class", "x25.facility.class", FT_UINT8, BASE_HEX, VALS(x25_facilities_class_vals), X25_FAC_CLASS_MASK, + NULL, HFILL }}, + { &hf_x25_facility_classA, + { "Code", "x25.facility.classA", FT_UINT8, BASE_HEX, VALS(x25_facilities_classA_vals), 0, + "Facility ClassA Code", HFILL }}, + { &hf_x25_facility_classA_comp_mark, + { "Parameter", "x25.facility.comp_mark", FT_UINT8, BASE_DEC, VALS(x25_facilities_classA_comp_mark_vals), 0, + "Facility Marker Parameter", HFILL }}, + { &hf_x25_facility_classA_reverse, + { "Parameter", "x25.facility.reverse", FT_UINT8, BASE_HEX, NULL, 0, + "Facility Reverse Charging Parameter", HFILL }}, + { &hf_x25_facility_classA_charging_info, + { "Parameter", "x25.facility.charging_info", FT_UINT8, BASE_HEX, NULL, 0, + "Facility Charging Information Parameter", HFILL }}, + { &hf_x25_facility_reverse_charging, + { "Reverse charging", "x25.reverse_charging", FT_BOOLEAN, 8, TFS(&x25_reverse_charging_val), 0x01, + NULL, HFILL }}, + { &hf_x25_facility_charging_info, + { "Charging information", "x25.charging_info", FT_BOOLEAN, 8, TFS(&tfs_requested_not_requested), 0x01, + NULL, HFILL }}, + { &hf_x25_facility_throughput_called_dte, + { "From the called DTE", "x25.facility.throughput.called_dte", FT_UINT8, BASE_DEC, VALS(x25_facilities_classA_throughput_vals), 0xF0, + "Facility Throughput called DTE", HFILL }}, + { &hf_x25_throughput_called_dte, + { "From the calling DTE", "x25.facility.throughput.called_dte", FT_UINT8, BASE_DEC, VALS(x25_facilities_classA_throughput_vals), 0x0F, + "Facility Throughput called DTE", HFILL }}, + { &hf_x25_facility_classA_cug, + { "Closed user group", "x25.facility.cug", FT_UINT8, BASE_HEX, NULL, 0, + "Facility Closed user group", HFILL }}, + { &hf_x25_facility_classA_called_motif, + { "Parameter", "x25.facility.called_motif", FT_UINT8, BASE_HEX, NULL, 0, + "Facility Called address modified parameter", HFILL }}, + { &hf_x25_facility_classA_cug_outgoing_acc, + { "Closed user group", "x25.facility.cug_outgoing_acc", FT_UINT8, BASE_HEX, NULL, 0, + "Facility Closed user group with outgoing access selection", HFILL }}, + { &hf_x25_facility_classA_throughput_min, + { "Parameter", "x25.facility.throughput_min", FT_UINT8, BASE_HEX, NULL, 0, + "Facility Minimum throughput class parameter", HFILL }}, + { &hf_x25_facility_classA_express_data, + { "Parameter", "x25.facility.express_data", FT_UINT8, BASE_HEX, NULL, 0, + "Facility Negotiation of express data parameter", HFILL }}, + { &hf_x25_facility_classA_unknown, + { "Parameter", "x25.facility.classA_unknown", FT_UINT8, BASE_HEX, NULL, 0, + "Facility Class A unknown parameter", HFILL }}, + { &hf_x25_facility_classB, + { "Code", "x25.facility.classB", FT_UINT8, BASE_HEX, VALS(x25_facilities_classB_vals), 0, + "Facility ClassB Code", HFILL }}, + { &hf_x25_facility_classB_bilateral_cug, + { "Bilateral CUG", "x25.facility.bilateral_cug", FT_UINT16, BASE_HEX, NULL, 0, + "Facility Bilateral CUG", HFILL }}, + { &hf_x25_facility_packet_size_called_dte, + { "From the called DTE", "x25.facility.packet_size.called_dte", FT_UINT8, BASE_DEC, VALS(x25_facilities_classB_packet_size_vals), 0, + "Facility Packet size from the called DTE", HFILL }}, + { &hf_x25_facility_packet_size_calling_dte, + { "From the calling DTE", "x25.facility.packet_size.calling_dte", FT_UINT8, BASE_DEC, VALS(x25_facilities_classB_packet_size_vals), 0, + "Facility Packet size from the calling DTE", HFILL }}, + { &hf_x25_facility_data_network_id_code, + { "Data network identification code", "x25.facility.data_network_id_code", FT_UINT16, BASE_HEX, NULL, 0, + "Facility RPOA selection data network identification code", HFILL }}, + { &hf_x25_facility_cug_ext, + { "Closed user group", "x25.facility.cug_ext", FT_UINT16, BASE_HEX, NULL, 0, + "Facility Extended closed user group selection", HFILL }}, + { &hf_x25_facility_cug_outgoing_acc_ext, + { "Closed user group", "x25.facility.cug_outgoing_acc_ext", FT_UINT16, BASE_HEX, NULL, 0, + "Facility Extended closed user group with outgoing access selection", HFILL }}, + { &hf_x25_facility_transit_delay, + { "Transit delay (ms)", "x25.facility.transit_delay", FT_UINT16, BASE_DEC, NULL, 0, + "Facility Transit delay selection and indication", HFILL }}, + { &hf_x25_facility_classB_unknown, + { "Parameter", "x25.facility.classB_unknown", FT_UINT16, BASE_HEX, NULL, 0, + "Facility Class B unknown parameter", HFILL }}, + { &hf_x25_facility_classC_unknown, + { "Parameter", "x25.facility.classC_unknown", FT_UINT24, BASE_HEX, NULL, 0, + "Facility Class C unknown parameter", HFILL }}, + { &hf_x25_facility_classC, + { "Code", "x25.facility.classC", FT_UINT8, BASE_HEX, VALS(x25_facilities_classC_vals), 0, + "Facility ClassC Code", HFILL }}, + { &hf_x25_facility_classD, + { "Code", "x25.facility.classD", FT_UINT8, BASE_HEX, VALS(x25_facilities_classD_vals), 0, + "Facility ClassD Code", HFILL }}, + { &hf_x25_gfi, + { "GFI", "x25.gfi", FT_UINT16, BASE_DEC, NULL, 0xF000, + "General format identifier", HFILL }}, + { &hf_x25_abit, + { "A Bit", "x25.a", FT_BOOLEAN, 16, NULL, X25_ABIT, + "Address Bit", HFILL }}, + { &hf_x25_qbit, + { "Q Bit", "x25.q", FT_BOOLEAN, 16, NULL, X25_QBIT, + "Qualifier Bit", HFILL }}, + { &hf_x25_dbit, + { "D Bit", "x25.d", FT_BOOLEAN, 16, NULL, X25_DBIT, + "Delivery Confirmation Bit", HFILL }}, + { &hf_x25_mod, + { "Modulo", "x25.mod", FT_UINT16, BASE_DEC, VALS(vals_modulo), 0x3000, + "Specifies whether the frame is modulo 8 or 128", HFILL }}, + { &hf_x25_lcn, + { "Logical Channel", "x25.lcn", FT_UINT16, BASE_DEC, NULL, 0x0FFF, + "Logical Channel Number", HFILL }}, + { &hf_x25_type, + { "Packet Type", "x25.type", FT_UINT8, BASE_HEX, VALS(vals_x25_type), 0x0, + NULL, HFILL }}, + { &hf_x25_type_fc_mod8, + { "Packet Type", "x25.type", FT_UINT8, BASE_HEX, VALS(vals_x25_type), 0x1F, + NULL, HFILL }}, + { &hf_x25_type_data, + { "Packet Type", "x25.type", FT_UINT8, BASE_HEX, VALS(vals_x25_type), 0x01, + NULL, HFILL }}, + { &hf_x25_diagnostic, + { "Diagnostic", "x25.diagnostic", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &x25_clear_diag_vals_ext, 0, + NULL, HFILL }}, + { &hf_x25_p_r_mod8, + { "P(R)", "x25.p_r", FT_UINT8, BASE_DEC, NULL, 0xE0, + "Packet Receive Sequence Number", HFILL }}, + { &hf_x25_p_r_mod128, + { "P(R)", "x25.p_r", FT_UINT8, BASE_DEC, NULL, 0xFE, + "Packet Receive Sequence Number", HFILL }}, + { &hf_x25_mbit_mod8, + { "M Bit", "x25.m", FT_BOOLEAN, 8, TFS(&m_bit_tfs), X25_MBIT_MOD8, + "More Bit", HFILL }}, + { &hf_x25_mbit_mod128, + { "M Bit", "x25.m", FT_BOOLEAN, 8, TFS(&m_bit_tfs), X25_MBIT_MOD128, + "More Bit", HFILL }}, + { &hf_x25_p_s_mod8, + { "P(S)", "x25.p_s", FT_UINT8, BASE_DEC, NULL, 0x0E, + "Packet Send Sequence Number", HFILL }}, + { &hf_x25_p_s_mod128, + { "P(S)", "x25.p_s", FT_UINT8, BASE_DEC, NULL, 0xFE, + "Packet Send Sequence Number", HFILL }}, + { &hf_x25_window_size_called_dte, + { "From the called DTE", "x25.window_size.called_dte", FT_UINT8, BASE_DEC, NULL, 0x7F, + NULL, HFILL }}, + { &hf_x25_window_size_calling_dte, + { "From the calling DTE", "x25.window_size.calling_dte", FT_UINT8, BASE_DEC, NULL, 0x7F, + NULL, HFILL }}, + { &hf_x25_dte_address_length, + { "DTE address length", "x25.dte_address_length", FT_UINT8, BASE_DEC, NULL, 0xF0, + NULL, HFILL }}, + { &hf_x25_dce_address_length, + { "DCE address length", "x25.dce_address_length", FT_UINT8, BASE_DEC, NULL, 0x0F, + NULL, HFILL }}, + { &hf_x25_calling_address_length, + { "Calling address length", "x25.calling_address_length", FT_UINT8, BASE_DEC, NULL, 0xF0, + NULL, HFILL }}, + { &hf_x25_called_address_length, + { "Called address length", "x25.called_address_length", FT_UINT8, BASE_DEC, NULL, 0x0F, + NULL, HFILL }}, + { &hf_x25_facility_call_transfer_reason, + { "Reason", "x25.facility.call_transfer_reason", FT_UINT8, BASE_DEC, VALS(x25_facilities_call_transfer_reason_vals), 0, + NULL, HFILL }}, + { &hf_x25_facility_monetary_unit, + { "Monetary unit", "x25.facility.monetary_unit", FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_nui, + { "NUI", "x25.facility.nui", FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_cumulative_ete_transit_delay, + { "Cumulative end-to-end transit delay (ms)", "x25.facility.cumulative_ete_transit_delay", FT_UINT16, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_requested_ete_transit_delay, + { "Requested end-to-end transit delay (ms)", "x25.facility.requested_ete_transit_delay", FT_UINT16, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_max_acceptable_ete_transit_delay, + { "Maximum acceptable end-to-end transit delay (ms)", "x25.facility.mac_acceptable_ete_transit_delay", FT_UINT16, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_priority_data, + { "Priority for data", "x25.facility.priority_data", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_priority_estab_conn, + { "Priority for establishing connection", "x25.facility.priority_estab_conn", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_priority_keep_conn, + { "Priority for keeping connection", "x25.facility.priority_keep_conn", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_min_acceptable_priority_data, + { "Minimum acceptable priority for data", "x25.facility.min_acceptable_priority_data", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_min_acceptable_priority_estab_conn, + { "Minimum acceptable priority for establishing connection", "x25.facility.min_acceptable_priority_estab_conn", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_min_acceptable_priority_keep_conn, + { "Minimum acceptable priority for keeping connection", "x25.facility.min_acceptable_priority_keep_conn", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_classD_unknown, + { "Parameter", "x25.facility.classD_unknown", FT_BYTES, BASE_NONE, NULL, 0, + "Facility Class D unknown parameter", HFILL }}, + { &hf_x25_facility_call_transfer_num_semi_octets, + { "Number of semi-octets in DTE address", "x25.facility.call_transfer_num_semi_octets", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_calling_addr_ext_num_semi_octets, + { "Number of semi-octets in DTE address", "x25.facility.calling_addr_ext_num_semi_octets", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_called_addr_ext_num_semi_octets, + { "Number of semi-octets in DTE address", "x25.facility.called_addr_ext_num_semi_octets", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x25_facility_call_deflect_num_semi_octets, + { "Number of semi-octets in the alternative DTE address", "x25.facility.call_deflect_num_semi_octets", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x264_length_indicator, + { "X.264 length indicator", "x25.x264_length_indicator", FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_x264_un_tpdu_id, + { "X.264 UN TPDU identifier", "x25.x264_un_tpdu_id", FT_UINT8, BASE_HEX, NULL, 0, + NULL, HFILL }}, + { &hf_x264_protocol_id, + { "X.264 protocol identifier", "x25.x264_protocol_id", FT_UINT8, BASE_HEX, VALS(prt_id_vals), 0, + NULL, HFILL }}, + { &hf_x264_sharing_strategy, + { "X.264 sharing strategy", "x25.x264_sharing_strategy", FT_UINT8, BASE_HEX, VALS(sharing_strategy_vals), 0, + NULL, HFILL }}, + { &hf_x263_sec_protocol_id, + { "X.263 secondary protocol ID", "x25.x263_sec_protocol_id", FT_UINT8, BASE_HEX, VALS(nlpid_vals), 0, + NULL, HFILL }}, + { &hf_x25_reg_request_length, + { "Registration length", "x25.reg_request_length", FT_UINT8, BASE_DEC, NULL, 0x7F, + NULL, HFILL }}, + { &hf_x25_reg_confirm_length, + { "Registration length", "x25.reg_confirm_length", FT_UINT8, BASE_DEC, NULL, 0x7F, + NULL, HFILL }}, + + { &hf_x25_segment_overlap, + { "Fragment overlap", "x25.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Fragment overlaps with other fragments", HFILL }}, + + { &hf_x25_segment_overlap_conflict, + { "Conflicting data in fragment overlap", "x25.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Overlapping fragments contained conflicting data", HFILL }}, + + { &hf_x25_segment_multiple_tails, + { "Multiple tail fragments found", "x25.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Several tails were found when defragmenting the packet", HFILL }}, + + { &hf_x25_segment_too_long_segment, + { "Fragment too long", "x25.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "Fragment contained data past end of packet", HFILL }}, + + { &hf_x25_segment_error, + { "Defragmentation error", "x25.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, + "Defragmentation error due to illegal fragments", HFILL }}, + + { &hf_x25_segment_count, + { "Fragment count", "x25.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + { &hf_x25_reassembled_length, + { "Reassembled X.25 length", "x25.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, + "The total length of the reassembled payload", HFILL }}, + + { &hf_x25_segment, + { "X.25 Fragment", "x25.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, + "X25 Fragment", HFILL }}, + + { &hf_x25_segments, + { "X.25 Fragments", "x25.fragments", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + { &hf_x25_fast_select, + { "Fast select", "x25.fast_select", FT_UINT8, BASE_DEC, VALS(x25_fast_select_vals), 0xC0, + NULL, HFILL }}, + + { &hf_x25_icrd, + { "ICRD", "x25.icrd", FT_UINT8, BASE_DEC, VALS(x25_icrd_vals), 0x30, + NULL, HFILL }}, + + { &hf_x25_reg_confirm_cause, + { "Cause", "x25.reg_confirm.cause", FT_UINT8, BASE_DEC, VALS(x25_registration_code_vals), 0, + NULL, HFILL }}, + + { &hf_x25_reg_confirm_diagnostic, + { "Diagnostic", "x25.reg_confirm.diagnostic", FT_UINT8, BASE_DEC, VALS(x25_registration_code_vals), 0, + NULL, HFILL }}, }; static gint *ett[] = { &ett_x25, - &ett_x25_gfi, - &ett_x25_facilities, - &ett_x25_facility, - &ett_x25_user_data, - &ett_x25_segment, - &ett_x25_segments + &ett_x25_gfi, + &ett_x25_facilities, + &ett_x25_facility, + &ett_x25_user_data, + &ett_x25_segment, + &ett_x25_segments }; static ei_register_info ei[] = { @@ -2427,7 +2427,7 @@ proto_register_x25(void) expert_register_field_array(expert_x25, ei, array_length(ei)); x25_subdissector_table = register_dissector_table("x.25.spi", - "X.25 secondary protocol identifier", FT_UINT8, BASE_HEX); + "X.25 secondary protocol identifier", FT_UINT8, BASE_HEX); register_heur_dissector_list("x.25", &x25_heur_subdissector_list); register_dissector("x.25_dir", dissect_x25_dir, proto_x25); @@ -2449,9 +2449,9 @@ proto_register_x25(void) "If CALL REQUEST not seen or didn't specify protocol, check user data before checking heuristic dissectors", &payload_check_data); prefs_register_bool_preference(x25_module, "reassemble", - "Reassemble fragmented X.25 packets", - "Reassemble fragmented X.25 packets", - &reassemble_x25); + "Reassemble fragmented X.25 packets", + "Reassemble fragmented X.25 packets", + &reassemble_x25); register_init_routine(&x25_reassemble_init); } @@ -2474,3 +2474,16 @@ proto_reg_handoff_x25(void) dissector_add_uint("lapd.sapi", LAPD_SAPI_X25, x25_handle); dissector_add_uint("ax25.pid", AX25_P_ROSE, x25_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff --git a/epan/dissectors/packet-xtp.c b/epan/dissectors/packet-xtp.c index da7ceafbaa..9605c4441d 100644 --- a/epan/dissectors/packet-xtp.c +++ b/epan/dissectors/packet-xtp.c @@ -175,36 +175,36 @@ static const value_string version_vals[] = { }; static const value_string service_vals[] = { - { XTP_TOS_UNSPEC, "Unspecified" }, - { XTP_TOS_UNACKED_DGRAM, "Traditional Unacknowledged Datagram Service" }, - { XTP_TOS_ACKED_DGRAM, "Acknowledged Datagram Service" }, - { XTP_TOS_TRANS, "Transaction Service" }, - { XTP_TOS_UNICAST_STREAM, "Traditional Reliable Unicast Stream Service" }, + { XTP_TOS_UNSPEC, "Unspecified" }, + { XTP_TOS_UNACKED_DGRAM, "Traditional Unacknowledged Datagram Service" }, + { XTP_TOS_ACKED_DGRAM, "Acknowledged Datagram Service" }, + { XTP_TOS_TRANS, "Transaction Service" }, + { XTP_TOS_UNICAST_STREAM, "Traditional Reliable Unicast Stream Service" }, { XTP_TOS_UNACKED_MULTICAST_STREAM, "Unacknowledged Multicast Stream Service" }, - { XTP_TOS_MULTICAST_STREAM, "Reliable Multicast Stream Service" }, + { XTP_TOS_MULTICAST_STREAM, "Reliable Multicast Stream Service" }, { 0, NULL } }; static const value_string aformat_vals[] = { - { XTP_ADDR_NULL, "Null Address" }, - { XTP_ADDR_IP, "Internet Protocol Address" }, - { XTP_ADDR_ISO, "ISO Connectionless Network Layer Protocol Address" }, + { XTP_ADDR_NULL, "Null Address" }, + { XTP_ADDR_IP, "Internet Protocol Address" }, + { XTP_ADDR_ISO, "ISO Connectionless Network Layer Protocol Address" }, { XTP_ADDR_XEROX, "Xerox Network System Address" }, - { XTP_ADDR_IPX, "IPX Address" }, + { XTP_ADDR_IPX, "IPX Address" }, { XTP_ADDR_LOCAL, "Local Address" }, - { XTP_ADDR_IP6, "Internet Protocol Version 6 Address" }, + { XTP_ADDR_IP6, "Internet Protocol Version 6 Address" }, { 0, NULL } }; static const value_string pformat_vals[] = { - { XTP_DATA_PKT, "DATA" }, - { XTP_CNTL_PKT, "CNTL" }, + { XTP_DATA_PKT, "DATA" }, + { XTP_CNTL_PKT, "CNTL" }, { XTP_FIRST_PKT, "FIRST" }, { XTP_ECNTL_PKT, "ECNTL" }, { XTP_TCNTL_PKT, "TCNTL" }, - { XTP_JOIN_PKT, "JOIN<obsolete>" }, + { XTP_JOIN_PKT, "JOIN<obsolete>" }, { XTP_JCNTL_PKT, "JCNTL" }, - { XTP_DIAG_PKT, "DIAG" }, + { XTP_DIAG_PKT, "DIAG" }, { 0, NULL } }; @@ -220,16 +220,16 @@ static const value_string diag_code_vals[] = { }; static const value_string diag_val_vals[] = { - { 0, "Unspecified" }, - { 1, "No listener" }, - { 2, "Options refused" }, - { 3, "Address format not supported" }, - { 4, "Malformed address format" }, - { 5, "Traffic format not supported" }, - { 6, "Traffic specification refused" }, - { 7, "Malformed traffic format" }, - { 8, "No provider for service" }, - { 9, "No resource" }, + { 0, "Unspecified" }, + { 1, "No listener" }, + { 2, "Options refused" }, + { 3, "Address format not supported" }, + { 4, "Malformed address format" }, + { 5, "Traffic format not supported" }, + { 6, "Traffic specification refused" }, + { 7, "Malformed traffic format" }, + { 8, "No provider for service" }, + { 9, "No resource" }, { 10, "Host going down" }, { 11, "Invalid retransmission request" }, { 12, "Context in improper state" }, @@ -327,12 +327,12 @@ static expert_field ei_xtp_spans_bad = EI_INIT; /* dissector of each payload */ static int dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - guint32 len = tvb_length_remaining(tvb, offset); - guint32 start = offset; - proto_item *ti, *ti2, *top_ti; - proto_tree *xtp_subtree; - struct xtp_ip_addr_seg aseg[1]; - int error = 0; + guint32 len = tvb_length_remaining(tvb, offset); + guint32 start = offset; + proto_item *ti, *ti2, *top_ti; + proto_tree *xtp_subtree; + struct xtp_ip_addr_seg aseg[1]; + int error = 0; xtp_subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_xtp_aseg, &top_ti, "Address Segment"); @@ -443,11 +443,11 @@ dissect_xtp_aseg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { static int dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { - guint32 len = tvb_length_remaining(tvb, offset); - guint32 start = offset; - proto_item *top_ti; - proto_tree *xtp_subtree; - struct xtp_traffic_cntl tcntl[1]; + guint32 len = tvb_length_remaining(tvb, offset); + guint32 start = offset; + proto_item *top_ti; + proto_tree *xtp_subtree; + struct xtp_traffic_cntl tcntl[1]; xtp_subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_xtp_tcntl, &top_ti, "Traffic Control Segment"); @@ -518,12 +518,12 @@ dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static int dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - guint32 len = tvb_length_remaining(tvb, offset); - guint32 start = offset; - proto_item *ti, *ti2; - proto_tree *xtp_subtree; - struct xtp_traffic_spec1 tspec[1]; - int error = 0; + guint32 len = tvb_length_remaining(tvb, offset); + guint32 start = offset; + proto_item *ti, *ti2; + proto_tree *xtp_subtree; + struct xtp_traffic_spec1 tspec[1]; + int error = 0; xtp_subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_xtp_tspec, &ti, "Traffic Specifier"); @@ -633,9 +633,9 @@ dissect_xtp_tspec(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { static void dissect_xtp_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, gboolean have_btag) { - guint32 len = tvb_length_remaining(tvb, offset); + guint32 len = tvb_length_remaining(tvb, offset); proto_tree *xtp_subtree; - guint64 btag; + guint64 btag; xtp_subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_xtp_data, NULL, "Data Segment"); @@ -656,11 +656,11 @@ dissect_xtp_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, gboolean have_ static void dissect_xtp_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { - guint32 len = tvb_length_remaining(tvb, offset); - guint32 start = offset; - proto_item *top_ti; - proto_tree *xtp_subtree; - struct xtp_cntl cntl[1]; + guint32 len = tvb_length_remaining(tvb, offset); + guint32 start = offset; + proto_item *top_ti; + proto_tree *xtp_subtree; + struct xtp_cntl cntl[1]; xtp_subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_xtp_cntl, &top_ti, "Common Control Segment"); @@ -727,13 +727,13 @@ dissect_xtp_first(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { static void dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { - guint32 len = tvb_length_remaining(tvb, offset); - guint32 start = offset; - proto_item *top_ti; - proto_tree *xtp_subtree; - struct xtp_ecntl ecntl[1]; - guint spans_len; - guint i; + guint32 len = tvb_length_remaining(tvb, offset); + guint32 start = offset; + proto_item *top_ti; + proto_tree *xtp_subtree; + struct xtp_ecntl ecntl[1]; + guint spans_len; + guint i; xtp_subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_xtp_ecntl, &top_ti, "Error Control Segment"); @@ -847,12 +847,12 @@ dissect_xtp_jcntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static void dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { - guint32 len = tvb_length_remaining(tvb, offset); - guint32 start = offset; - proto_item *ti; - proto_tree *xtp_subtree; - struct xtp_diag diag[1]; - guint32 msg_len; + guint32 len = tvb_length_remaining(tvb, offset); + guint32 start = offset; + proto_item *ti; + proto_tree *xtp_subtree; + struct xtp_diag diag[1]; + guint32 msg_len; xtp_subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_xtp_diag, &ti, "Diagnostic Segment"); @@ -895,21 +895,21 @@ dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { /* main dissector */ static int dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - guint32 offset, len; - proto_item *ti; - proto_tree *xtp_tree, *xtp_cmd_tree, *xtp_subtree; - struct xtphdr xtph[1]; - int error = 0; - gchar *options; + guint32 offset, len; + proto_item *ti; + proto_tree *xtp_tree, *xtp_cmd_tree, *xtp_subtree; + struct xtphdr xtph[1]; + int error = 0; + gchar *options; static const char *fstr[] = { "<None>", "NOCHECK", "EDGE", "NOERR", "MULTI", "RES", "SORT", "NOFLOW", "FASTNAK", "SREQ", "DREQ", "RCLOSE", "WCLOSE", "EOM", "END", "BTAG" }; - gint fpos = 0, returned_length; - guint i, bpos; - guint cmd_options; - vec_t cksum_vec[1]; - guint16 computed_cksum; - gboolean have_btag; + gint fpos = 0, returned_length; + guint i, bpos; + guint cmd_options; + vec_t cksum_vec[1]; + guint16 computed_cksum; + gboolean have_btag; if ((len = tvb_length(tvb)) < XTP_HEADER_LEN) return 0; @@ -1124,272 +1124,272 @@ proto_register_xtp(void) static hf_register_info hf[] = { /* command header */ { &hf_xtp_key, - { "Key", "xtp.key", - FT_UINT64, BASE_HEX, NULL, 0x0, - NULL, HFILL } + { "Key", "xtp.key", + FT_UINT64, BASE_HEX, NULL, 0x0, + NULL, HFILL } }, { &hf_xtp_cmd, - { "Command", "xtp.cmd", - FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } + { "Command", "xtp.cmd", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_cmd_options, - { "Options", "xtp.cmd.options", - FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } + { "Options", "xtp.cmd.options", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_cmd_options_nocheck, - { "NOCHECK", "xtp.cmd.options.nocheck", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_NOCHECK, NULL, HFILL } + { "NOCHECK", "xtp.cmd.options.nocheck", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_NOCHECK, NULL, HFILL } }, { &hf_xtp_cmd_options_edge, - { "EDGE", "xtp.cmd.options.edge", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_EDGE, NULL, HFILL } + { "EDGE", "xtp.cmd.options.edge", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_EDGE, NULL, HFILL } }, { &hf_xtp_cmd_options_noerr, - { "NOERR", "xtp.cmd.options.noerr", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_NOERR, NULL, HFILL } + { "NOERR", "xtp.cmd.options.noerr", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_NOERR, NULL, HFILL } }, { &hf_xtp_cmd_options_multi, - { "MULTI", "xtp.cmd.options.multi", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_MULTI, NULL, HFILL } + { "MULTI", "xtp.cmd.options.multi", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_MULTI, NULL, HFILL } }, { &hf_xtp_cmd_options_res, - { "RES", "xtp.cmd.options.res", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_RES, NULL, HFILL } + { "RES", "xtp.cmd.options.res", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_RES, NULL, HFILL } }, { &hf_xtp_cmd_options_sort, - { "SORT", "xtp.cmd.options.sort", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_SORT, NULL, HFILL } + { "SORT", "xtp.cmd.options.sort", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_SORT, NULL, HFILL } }, { &hf_xtp_cmd_options_noflow, - { "NOFLOW", "xtp.cmd.options.noflow", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_NOFLOW, NULL, HFILL } + { "NOFLOW", "xtp.cmd.options.noflow", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_NOFLOW, NULL, HFILL } }, { &hf_xtp_cmd_options_fastnak, - { "FASTNAK", "xtp.cmd.options.fastnak", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_FASTNAK, NULL, HFILL } + { "FASTNAK", "xtp.cmd.options.fastnak", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_FASTNAK, NULL, HFILL } }, { &hf_xtp_cmd_options_sreq, - { "SREQ", "xtp.cmd.options.sreq", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_SREQ, NULL, HFILL } + { "SREQ", "xtp.cmd.options.sreq", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_SREQ, NULL, HFILL } }, { &hf_xtp_cmd_options_dreq, - { "DREQ", "xtp.cmd.options.dreq", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_DREQ, NULL, HFILL } + { "DREQ", "xtp.cmd.options.dreq", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_DREQ, NULL, HFILL } }, { &hf_xtp_cmd_options_rclose, - { "RCLOSE", "xtp.cmd.options.rclose", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_RCLOSE, NULL, HFILL } + { "RCLOSE", "xtp.cmd.options.rclose", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_RCLOSE, NULL, HFILL } }, { &hf_xtp_cmd_options_wclose, - { "WCLOSE", "xtp.cmd.options.wclose", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_WCLOSE, NULL, HFILL } + { "WCLOSE", "xtp.cmd.options.wclose", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_WCLOSE, NULL, HFILL } }, { &hf_xtp_cmd_options_eom, - { "EOM", "xtp.cmd.options.eom", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_EOM, NULL, HFILL } + { "EOM", "xtp.cmd.options.eom", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_EOM, NULL, HFILL } }, { &hf_xtp_cmd_options_end, - { "END", "xtp.cmd.options.end", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_END, NULL, HFILL } + { "END", "xtp.cmd.options.end", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_END, NULL, HFILL } }, { &hf_xtp_cmd_options_btag, - { "BTAG", "xtp.cmd.options.btag", - FT_BOOLEAN, 24, TFS(&tfs_set_notset), - XTP_CMD_OPTIONS_BTAG, NULL, HFILL } + { "BTAG", "xtp.cmd.options.btag", + FT_BOOLEAN, 24, TFS(&tfs_set_notset), + XTP_CMD_OPTIONS_BTAG, NULL, HFILL } }, { &hf_xtp_cmd_ptype, - { "Packet type", "xtp.cmd.ptype", - FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } + { "Packet type", "xtp.cmd.ptype", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_cmd_ptype_ver, - { "Version", "xtp.cmd.ptype.ver", - FT_UINT8, BASE_DEC, VALS(version_vals), 0x0, NULL, HFILL } + { "Version", "xtp.cmd.ptype.ver", + FT_UINT8, BASE_DEC, VALS(version_vals), 0x0, NULL, HFILL } }, { &hf_xtp_cmd_ptype_pformat, - { "Format", "xtp.cmd.ptype.pformat", - FT_UINT8, BASE_DEC, VALS(pformat_vals), 0x0, NULL, HFILL } + { "Format", "xtp.cmd.ptype.pformat", + FT_UINT8, BASE_DEC, VALS(pformat_vals), 0x0, NULL, HFILL } }, { &hf_xtp_dlen, - { "Data length", "xtp.dlen", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Data length", "xtp.dlen", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_sort, - { "Sort", "xtp.sort", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Sort", "xtp.sort", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_sync, - { "Synchronizing handshake", "xtp.sync", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Synchronizing handshake", "xtp.sync", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_seq, - { "Sequence number", "xtp.seq", - FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Sequence number", "xtp.seq", + FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* control segment */ { &hf_xtp_cntl_rseq, - { "Received sequence number", "xtp.cntl.rseq", - FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Received sequence number", "xtp.cntl.rseq", + FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_cntl_alloc, - { "Allocation", "xtp.cntl.alloc", - FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Allocation", "xtp.cntl.alloc", + FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_cntl_echo, - { "Synchronizing handshake echo", "xtp.cntl.echo", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Synchronizing handshake echo", "xtp.cntl.echo", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_ecntl_rseq, - { "Received sequence number", "xtp.ecntl.rseq", - FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Received sequence number", "xtp.ecntl.rseq", + FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_ecntl_alloc, - { "Allocation", "xtp.ecntl.alloc", - FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Allocation", "xtp.ecntl.alloc", + FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_ecntl_echo, - { "Synchronizing handshake echo", "xtp.ecntl.echo", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Synchronizing handshake echo", "xtp.ecntl.echo", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_ecntl_nspan, - { "Number of spans", "xtp.ecntl.nspan", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Number of spans", "xtp.ecntl.nspan", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_ecntl_span_left, - { "Span left edge", "xtp.ecntl.span_le", - FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Span left edge", "xtp.ecntl.span_le", + FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_ecntl_span_right, - { "Span right edge", "xtp.ecntl.span_re", - FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Span right edge", "xtp.ecntl.span_re", + FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tcntl_rseq, - { "Received sequence number", "xtp.tcntl.rseq", - FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Received sequence number", "xtp.tcntl.rseq", + FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tcntl_alloc, - { "Allocation", "xtp.tcntl.alloc", - FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Allocation", "xtp.tcntl.alloc", + FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tcntl_echo, - { "Synchronizing handshake echo", "xtp.tcntl.echo", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Synchronizing handshake echo", "xtp.tcntl.echo", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tcntl_rsvd, - { "Reserved", "xtp.tcntl.rsvd", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Reserved", "xtp.tcntl.rsvd", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tcntl_xkey, - { "Exchange key", "xtp.tcntl.xkey", - FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } + { "Exchange key", "xtp.tcntl.xkey", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* traffic specifier */ { &hf_xtp_tspec_tlen, - { "Length", "xtp.tspec.tlen", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Length", "xtp.tspec.tlen", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tspec_service, - { "Service", "xtp.tspec.service", - FT_UINT8, BASE_DEC, VALS(service_vals), 0x0, NULL, HFILL } + { "Service", "xtp.tspec.service", + FT_UINT8, BASE_DEC, VALS(service_vals), 0x0, NULL, HFILL } }, { &hf_xtp_tspec_tformat, - { "Format", "xtp.tspec.format", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Format", "xtp.tspec.format", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tspec_traffic, - { "Traffic", "xtp.tspec.traffic", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Traffic", "xtp.tspec.traffic", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tspec_maxdata, - { "Maxdata", "xtp.tspec.maxdata", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Maxdata", "xtp.tspec.maxdata", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tspec_inrate, - { "Incoming rate", "xtp.tspec.inrate", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Incoming rate", "xtp.tspec.inrate", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tspec_inburst, - { "Incoming burst size", "xtp.tspec.inburst", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Incoming burst size", "xtp.tspec.inburst", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tspec_outrate, - { "Outgoing rate", "xtp.tspec.outrate", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Outgoing rate", "xtp.tspec.outrate", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_tspec_outburst, - { "Outgoing burst size", "xtp.tspec.outburst", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Outgoing burst size", "xtp.tspec.outburst", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* address segment */ { &hf_xtp_aseg_alen, - { "Length", "xtp.aseg.alen", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Length", "xtp.aseg.alen", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_aseg_adomain, - { "Domain", "xtp.aseg.adomain", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Domain", "xtp.aseg.adomain", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_aseg_aformat, - { "Format", "xtp.aseg.aformat", - FT_UINT8, BASE_DEC, VALS(aformat_vals), 0x0, NULL, HFILL } + { "Format", "xtp.aseg.aformat", + FT_UINT8, BASE_DEC, VALS(aformat_vals), 0x0, NULL, HFILL } }, { &hf_xtp_aseg_address, - { "Traffic", "xtp.aseg.address", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Traffic", "xtp.aseg.address", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_aseg_dsthost, - { "Destination host", "xtp.aseg.dsthost", - FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } + { "Destination host", "xtp.aseg.dsthost", + FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_aseg_srchost, - { "Source host", "xtp.aseg.srchost", - FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } + { "Source host", "xtp.aseg.srchost", + FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_aseg_dstport, - { "Destination port", "xtp.aseg.dstport", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Destination port", "xtp.aseg.dstport", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_aseg_srcport, - { "Source port", "xtp.aseg.srcport", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Source port", "xtp.aseg.srcport", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* others */ { &hf_xtp_btag, - { "Beginning tag", "xtp.data.btag", - FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } + { "Beginning tag", "xtp.data.btag", + FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_diag_code, - { "Diagnostic code", "xtp.diag.code", - FT_UINT32, BASE_DEC, VALS(diag_code_vals), 0x0, NULL, HFILL } + { "Diagnostic code", "xtp.diag.code", + FT_UINT32, BASE_DEC, VALS(diag_code_vals), 0x0, NULL, HFILL } }, { &hf_xtp_diag_val, - { "Diagnostic value", "xtp.diag.val", - FT_UINT32, BASE_DEC, VALS(diag_val_vals), 0x0, NULL, HFILL } + { "Diagnostic value", "xtp.diag.val", + FT_UINT32, BASE_DEC, VALS(diag_val_vals), 0x0, NULL, HFILL } }, { &hf_xtp_diag_msg, - { "Message", "xtp.diag.msg", - FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } + { "Message", "xtp.diag.msg", + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_checksum, - { "Checksum", "xtp.checksum", - FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } + { "Checksum", "xtp.checksum", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_xtp_data, - { "Data", "xtp.data", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + { "Data", "xtp.data", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; @@ -1409,14 +1409,15 @@ proto_register_xtp(void) &ett_xtp_diag, }; - static ei_register_info ei[] = { - { &ei_xtp_spans_bad, { "xtp.spans_bad", PI_MALFORMED, PI_ERROR, "Number of spans incorrect", EXPFILL }}, - }; + static ei_register_info ei[] = { + { &ei_xtp_spans_bad, + { "xtp.spans_bad", PI_MALFORMED, PI_ERROR, "Number of spans incorrect", EXPFILL }}, + }; - expert_module_t* expert_xtp; + expert_module_t* expert_xtp; - expert_xtp = expert_register_protocol(proto_xtp); - expert_register_field_array(expert_xtp, ei, array_length(ei)); + expert_xtp = expert_register_protocol(proto_xtp); + expert_register_field_array(expert_xtp, ei, array_length(ei)); proto_xtp = proto_register_protocol("Xpress Transport Protocol", "XTP", "xtp"); @@ -1432,3 +1433,16 @@ proto_reg_handoff_xtp(void) xtp_handle = new_create_dissector_handle(dissect_xtp, proto_xtp); dissector_add_uint("ip.proto", IP_PROTO_XTP, xtp_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ |