diff options
author | Bill Meier <wmeier@newsguy.com> | 2009-10-10 16:57:20 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2009-10-10 16:57:20 +0000 |
commit | 9ac4174e414cb750f93cc23502341acb26dc5b87 (patch) | |
tree | 11a9bc0f2d92f2a8c9324add8a65318210716d4a /epan/dissectors/packet-ncp.c | |
parent | b57e27ef8e89bed26c0e4fe3e066922618a3b675 (diff) |
Use consistent indentation
svn path=/trunk/; revision=30479
Diffstat (limited to 'epan/dissectors/packet-ncp.c')
-rw-r--r-- | epan/dissectors/packet-ncp.c | 562 |
1 files changed, 281 insertions, 281 deletions
diff --git a/epan/dissectors/packet-ncp.c b/epan/dissectors/packet-ncp.c index 03cc391694..67d945f937 100644 --- a/epan/dissectors/packet-ncp.c +++ b/epan/dissectors/packet-ncp.c @@ -103,7 +103,7 @@ gint ett_nds_segment = -1; static gint ett_ncp_system_flags = -1; static struct novell_tap ncp_tap; -struct ncp_common_header header; +struct ncp_common_header header; struct ncp_common_header *ncp_hdr; /* Tables for reassembly of fragments. */ @@ -116,72 +116,72 @@ static gboolean ncp_desegment = TRUE; static dissector_handle_t data_handle; -#define TCP_PORT_NCP 524 -#define UDP_PORT_NCP 524 +#define TCP_PORT_NCP 524 +#define UDP_PORT_NCP 524 -#define NCP_RQST_HDR_LENGTH 7 -#define NCP_RPLY_HDR_LENGTH 8 +#define NCP_RQST_HDR_LENGTH 7 +#define NCP_RPLY_HDR_LENGTH 8 /* These are the header structures to handle NCP over IP */ -#define NCPIP_RQST 0x446d6454 /* "DmdT" */ -#define NCPIP_RPLY 0x744e6350 /* "tNcP" */ +#define NCPIP_RQST 0x446d6454 /* "DmdT" */ +#define NCPIP_RPLY 0x744e6350 /* "tNcP" */ struct ncp_ip_header { - guint32 signature; - guint32 length; + guint32 signature; + guint32 length; }; /* This header only appears on NCP over IP request packets */ struct ncp_ip_rqhdr { - guint32 version; - guint32 rplybufsize; + guint32 version; + guint32 rplybufsize; }; static const value_string ncp_ip_signature[] = { - { NCPIP_RQST, "Demand Transport (Request)" }, - { NCPIP_RPLY, "Transport is NCP (Reply)" }, - { 0, NULL }, + { NCPIP_RQST, "Demand Transport (Request)" }, + { NCPIP_RPLY, "Transport is NCP (Reply)" }, + { 0, NULL }, }; static const value_string burst_command[] = { - { 0x01000000, "Burst Read" }, - { 0x02000000, "Burst Write" }, - { 0, NULL }, + { 0x01000000, "Burst Read" }, + { 0x02000000, "Burst Write" }, + { 0, NULL }, }; /* The information in this module comes from: - NetWare LAN Analysis, Second Edition - Laura A. Chappell and Dan E. Hakes - (c) 1994 Novell, Inc. - Novell Press, San Jose. - ISBN: 0-7821-1362-1 + NetWare LAN Analysis, Second Edition + Laura A. Chappell and Dan E. Hakes + (c) 1994 Novell, Inc. + Novell Press, San Jose. + ISBN: 0-7821-1362-1 - And from the ncpfs source code by Volker Lendecke + And from the ncpfs source code by Volker Lendecke - And: - Programmer's Guide to the NetWare Core Protocol - Steve Conner & Diane Conner - (c) 1996 by Steve Conner & Diane Conner - Published by Annabooks, San Diego, California - ISBN: 0-929392-31-0 + And: + Programmer's Guide to the NetWare Core Protocol + Steve Conner & Diane Conner + (c) 1996 by Steve Conner & Diane Conner + Published by Annabooks, San Diego, California + ISBN: 0-929392-31-0 - And: - http:developer.novell.com - NCP documentation + And: + http:developer.novell.com + NCP documentation */ static const value_string ncp_type_vals[] = { - { NCP_ALLOCATE_SLOT, "Create a service connection" }, - { NCP_SERVICE_REQUEST, "Service request" }, - { NCP_SERVICE_REPLY, "Service reply" }, - { NCP_WATCHDOG, "Watchdog" }, - { NCP_DEALLOCATE_SLOT, "Destroy service connection" }, - { NCP_BROADCAST_SLOT, "Server Broadcast" }, - { NCP_BURST_MODE_XFER, "Burst mode transfer" }, - { NCP_POSITIVE_ACK, "Request being processed" }, - { NCP_LIP_ECHO, "Large Internet Packet Echo" }, - { 0, NULL } + { NCP_ALLOCATE_SLOT, "Create a service connection" }, + { NCP_SERVICE_REQUEST, "Service request" }, + { NCP_SERVICE_REPLY, "Service reply" }, + { NCP_WATCHDOG, "Watchdog" }, + { NCP_DEALLOCATE_SLOT, "Destroy service connection" }, + { NCP_BROADCAST_SLOT, "Server Broadcast" }, + { NCP_BURST_MODE_XFER, "Burst mode transfer" }, + { NCP_POSITIVE_ACK, "Request being processed" }, + { NCP_LIP_ECHO, "Large Internet Packet Echo" }, + { 0, NULL } }; static const value_string ncp_oplock_vals[] = { @@ -193,7 +193,7 @@ static const value_string ncp_oplock_vals[] = { /* Conversation Struct so we can detect NCP server sessions */ typedef struct { - conversation_t *conversation; + conversation_t *conversation; guint32 nwconnection; guint8 nwtask; } mncp_rhash_key; @@ -206,7 +206,7 @@ typedef struct { * Operating Systems. */ typedef struct { - guint32 session_start_packet_num; + guint32 session_start_packet_num; } mncp_rhash_value; static GHashTable *mncp_rhash = NULL; @@ -215,20 +215,20 @@ static GHashTable *mncp_rhash = NULL; static gint mncp_equal(gconstpointer v, gconstpointer v2) { - const mncp_rhash_key *val1 = (const mncp_rhash_key*)v; - const mncp_rhash_key *val2 = (const mncp_rhash_key*)v2; + const mncp_rhash_key *val1 = (const mncp_rhash_key*)v; + const mncp_rhash_key *val2 = (const mncp_rhash_key*)v2; - if (val1->conversation == val2->conversation && val1->nwconnection == val2->nwconnection && val1->nwtask == val2->nwtask) { - return 1; - } - return 0; + if (val1->conversation == val2->conversation && val1->nwconnection == val2->nwconnection && val1->nwtask == val2->nwtask) { + return 1; + } + return 0; } static guint mncp_hash(gconstpointer v) { - const mncp_rhash_key *mncp_key = (const mncp_rhash_key*)v; - return GPOINTER_TO_UINT(mncp_key->conversation)+mncp_key->nwconnection+mncp_key->nwtask; + const mncp_rhash_key *mncp_key = (const mncp_rhash_key*)v; + return GPOINTER_TO_UINT(mncp_key->conversation)+mncp_key->nwconnection+mncp_key->nwtask; } /* Initializes the hash table and the mem_chunk area each time a new @@ -236,10 +236,10 @@ mncp_hash(gconstpointer v) static void mncp_init_protocol(void) { - if (mncp_rhash) - g_hash_table_destroy(mncp_rhash); + if (mncp_rhash) + g_hash_table_destroy(mncp_rhash); - mncp_rhash = g_hash_table_new(mncp_hash, mncp_equal); + mncp_rhash = g_hash_table_new(mncp_hash, mncp_equal); } /* After the sequential run, we don't need the ncp_request hash and keys @@ -866,247 +866,247 @@ get_ncp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) static void dissect_ncp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - dissect_ncp_common(tvb, pinfo, tree, TRUE); + dissect_ncp_common(tvb, pinfo, tree, TRUE); } static void dissect_ncp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - tcp_dissect_pdus(tvb, pinfo, tree, ncp_desegment, 8, get_ncp_pdu_len, - dissect_ncp_tcp_pdu); + tcp_dissect_pdus(tvb, pinfo, tree, ncp_desegment, 8, get_ncp_pdu_len, + dissect_ncp_tcp_pdu); } void proto_register_ncp(void) { - static hf_register_info hf[] = { - { &hf_ncp_ip_sig, - { "NCP over IP signature", "ncp.ip.signature", - FT_UINT32, BASE_HEX, VALS(ncp_ip_signature), 0x0, - NULL, HFILL }}, - { &hf_ncp_ip_length, - { "NCP over IP length", "ncp.ip.length", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_ip_ver, - { "NCP over IP Version", "ncp.ip.version", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_ip_rplybufsize, - { "NCP over IP Reply Buffer Size", "ncp.ip.replybufsize", - FT_UINT32, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_ip_packetsig, - { "NCP over IP Packet Signature", "ncp.ip.packetsig", - FT_BYTES, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_type, - { "Type", "ncp.type", - FT_UINT16, BASE_HEX, VALS(ncp_type_vals), 0x0, - "NCP message type", HFILL }}, - { &hf_ncp_seq, - { "Sequence Number", "ncp.seq", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_connection, - { "Connection Number", "ncp.connection", - FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_task, - { "Task Number", "ncp.task", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_oplock_flag, - { "Broadcast Message Flag", "ncp.msg_flag", - FT_UINT8, BASE_HEX, VALS(ncp_oplock_vals), 0x0, - NULL, HFILL }}, - { &hf_ncp_oplock_handle, - { "File Handle", "ncp.oplock_handle", - FT_UINT16, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_stream_type, - { "Stream Type", "ncp.stream_type", - FT_UINT8, BASE_HEX, NULL, 0x0, - "Type of burst", HFILL }}, - { &hf_ncp_system_flags, - { "System Flags", "ncp.system_flags", - FT_UINT8, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_system_flags_abt, - { "ABT", "ncp.system_flags.abt", - FT_BOOLEAN, 8, NULL, ABT, - "Is this an abort request?", HFILL }}, - { &hf_ncp_system_flags_eob, - { "EOB", "ncp.system_flags.eob", - FT_BOOLEAN, 8, NULL, EOB, - "Is this the last packet of the burst?", HFILL }}, - { &hf_ncp_system_flags_sys, - { "SYS", "ncp.system_flags.sys", - FT_BOOLEAN, 8, NULL, SYS, - "Is this a system packet?", HFILL }}, - { &hf_ncp_system_flags_bsy, - { "BSY", "ncp.system_flags.bsy", - FT_BOOLEAN, 8, NULL, BSY, - "Is the server busy?", HFILL }}, - { &hf_ncp_system_flags_lst, - { "LST", "ncp.system_flags.lst", - FT_BOOLEAN, 8, NULL, LST, - "Return Fragment List?", HFILL }}, - { &hf_ncp_src_connection, - { "Source Connection ID", "ncp.src_connection", - FT_UINT32, BASE_DEC, NULL, 0x0, - "The workstation's connection identification number", HFILL }}, - { &hf_ncp_dst_connection, - { "Destination Connection ID", "ncp.dst_connection", - FT_UINT32, BASE_DEC, NULL, 0x0, - "The server's connection identification number", HFILL }}, - { &hf_ncp_packet_seqno, - { "Packet Sequence Number", "ncp.packet_seqno", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Sequence number of this packet in a burst", HFILL }}, - { &hf_ncp_delay_time, - { "Delay Time", "ncp.delay_time", /* in 100 us increments */ - FT_UINT32, BASE_DEC, NULL, 0x0, - "Delay time between consecutive packet sends (100 us increments)", HFILL }}, - { &hf_ncp_burst_seqno, - { "Burst Sequence Number", "ncp.burst_seqno", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Sequence number of this packet in the burst", HFILL }}, - { &hf_ncp_ack_seqno, - { "ACK Sequence Number", "ncp.ack_seqno", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Next expected burst sequence number", HFILL }}, - { &hf_ncp_burst_len, - { "Burst Length", "ncp.burst_len", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Total length of data in this burst", HFILL }}, - { &hf_ncp_burst_offset, - { "Burst Offset", "ncp.burst_offset", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Offset of data in the burst", HFILL }}, - { &hf_ncp_data_offset, - { "Data Offset", "ncp.data_offset", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Offset of this packet", HFILL }}, - { &hf_ncp_data_bytes, - { "Data Bytes", "ncp.data_bytes", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Number of data bytes in this packet", HFILL }}, - { &hf_ncp_missing_fraglist_count, - { "Missing Fragment List Count", "ncp.missing_fraglist_count", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Number of missing fragments reported", HFILL }}, - { &hf_ncp_missing_data_offset, - { "Missing Data Offset", "ncp.missing_data_offset", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Offset of beginning of missing data", HFILL }}, - { &hf_ncp_missing_data_count, - { "Missing Data Count", "ncp.missing_data_count", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Number of bytes of missing data", HFILL }}, - { &hf_ncp_completion_code, - { "Completion Code", "ncp.completion_code", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_connection_status, - { "Connection Status", "ncp.connection_status", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_slot, - { "Slot", "ncp.slot", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_control_code, - { "Control Code", "ncp.control_code", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_fragment_handle, - { "Fragment Handle", "ncp.fragger_hndl", - FT_UINT16, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - { &hf_lip_echo, - { "Large Internet Packet Echo", "ncp.lip_echo", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL }}, - { &hf_ncp_burst_command, - { "Burst Command", "ncp.burst_command", - FT_UINT32, BASE_HEX, VALS(burst_command), 0x0, - "Packet Burst Command", HFILL }}, - { &hf_ncp_burst_file_handle, - { "Burst File Handle", "ncp.file_handle", - FT_UINT32, BASE_HEX, NULL, 0x0, - "Packet Burst File Handle", HFILL }}, - { &hf_ncp_burst_reserved, - { "Reserved", "ncp.burst_reserved", - FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - - }; - static gint *ett[] = { - &ett_ncp, - &ett_ncp_system_flags, - &ett_nds, - &ett_nds_segments, - &ett_nds_segment, - }; - module_t *ncp_module; - - proto_ncp = proto_register_protocol("NetWare Core Protocol", "NCP", "ncp"); - proto_register_field_array(proto_ncp, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - - ncp_module = prefs_register_protocol(proto_ncp, NULL); - prefs_register_obsolete_preference(ncp_module, "initial_hash_size"); - prefs_register_bool_preference(ncp_module, "desegment", - "Reassemble NCP-over-TCP messages spanning multiple TCP segments", - "Whether the NCP dissector should reassemble messages spanning multiple TCP segments." - " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", - &ncp_desegment); - prefs_register_bool_preference(ncp_module, "defragment_nds", - "Reassemble fragmented NDS messages spanning multiple reply packets", - "Whether the NCP dissector should defragment NDS messages spanning multiple reply packets.", - &nds_defragment); - prefs_register_bool_preference(ncp_module, "newstyle", - "Dissect New Netware Information Structure", - "Dissect the NetWare Information Structure as NetWare 5.x or higher or as older NetWare 3.x.", - &ncp_newstyle); - prefs_register_bool_preference(ncp_module, "eid_2_expert", - "Expert: EID to Name lookups?", - "Whether the NCP dissector should echo the NDS Entry ID to name resolves to the expert table.", - &nds_echo_eid); - prefs_register_bool_preference(ncp_module, "connection_2_expert", - "Expert: NCP Connections?", - "Whether the NCP dissector should echo NCP connection information to the expert table.", - &ncp_echo_conn); - prefs_register_bool_preference(ncp_module, "error_2_expert", - "Expert: NCP Errors?", - "Whether the NCP dissector should echo protocol errors to the expert table.", - &ncp_echo_err); - prefs_register_bool_preference(ncp_module, "server_2_expert", - "Expert: Server Information?", - "Whether the NCP dissector should echo server information to the expert table.", - &ncp_echo_server); - prefs_register_bool_preference(ncp_module, "file_2_expert", - "Expert: File Information?", - "Whether the NCP dissector should echo file open/close/oplock information to the expert table.", - &ncp_echo_file); - register_init_routine(&mncp_init_protocol); - ncp_tap.stat=register_tap("ncp_srt"); - ncp_tap.hdr=register_tap("ncp_hdr"); - register_postseq_cleanup_routine(&mncp_postseq_cleanup); + static hf_register_info hf[] = { + { &hf_ncp_ip_sig, + { "NCP over IP signature", "ncp.ip.signature", + FT_UINT32, BASE_HEX, VALS(ncp_ip_signature), 0x0, + NULL, HFILL }}, + { &hf_ncp_ip_length, + { "NCP over IP length", "ncp.ip.length", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_ip_ver, + { "NCP over IP Version", "ncp.ip.version", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_ip_rplybufsize, + { "NCP over IP Reply Buffer Size", "ncp.ip.replybufsize", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_ip_packetsig, + { "NCP over IP Packet Signature", "ncp.ip.packetsig", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_type, + { "Type", "ncp.type", + FT_UINT16, BASE_HEX, VALS(ncp_type_vals), 0x0, + "NCP message type", HFILL }}, + { &hf_ncp_seq, + { "Sequence Number", "ncp.seq", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_connection, + { "Connection Number", "ncp.connection", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_task, + { "Task Number", "ncp.task", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_oplock_flag, + { "Broadcast Message Flag", "ncp.msg_flag", + FT_UINT8, BASE_HEX, VALS(ncp_oplock_vals), 0x0, + NULL, HFILL }}, + { &hf_ncp_oplock_handle, + { "File Handle", "ncp.oplock_handle", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_stream_type, + { "Stream Type", "ncp.stream_type", + FT_UINT8, BASE_HEX, NULL, 0x0, + "Type of burst", HFILL }}, + { &hf_ncp_system_flags, + { "System Flags", "ncp.system_flags", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_system_flags_abt, + { "ABT", "ncp.system_flags.abt", + FT_BOOLEAN, 8, NULL, ABT, + "Is this an abort request?", HFILL }}, + { &hf_ncp_system_flags_eob, + { "EOB", "ncp.system_flags.eob", + FT_BOOLEAN, 8, NULL, EOB, + "Is this the last packet of the burst?", HFILL }}, + { &hf_ncp_system_flags_sys, + { "SYS", "ncp.system_flags.sys", + FT_BOOLEAN, 8, NULL, SYS, + "Is this a system packet?", HFILL }}, + { &hf_ncp_system_flags_bsy, + { "BSY", "ncp.system_flags.bsy", + FT_BOOLEAN, 8, NULL, BSY, + "Is the server busy?", HFILL }}, + { &hf_ncp_system_flags_lst, + { "LST", "ncp.system_flags.lst", + FT_BOOLEAN, 8, NULL, LST, + "Return Fragment List?", HFILL }}, + { &hf_ncp_src_connection, + { "Source Connection ID", "ncp.src_connection", + FT_UINT32, BASE_DEC, NULL, 0x0, + "The workstation's connection identification number", HFILL }}, + { &hf_ncp_dst_connection, + { "Destination Connection ID", "ncp.dst_connection", + FT_UINT32, BASE_DEC, NULL, 0x0, + "The server's connection identification number", HFILL }}, + { &hf_ncp_packet_seqno, + { "Packet Sequence Number", "ncp.packet_seqno", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Sequence number of this packet in a burst", HFILL }}, + { &hf_ncp_delay_time, + { "Delay Time", "ncp.delay_time", /* in 100 us increments */ + FT_UINT32, BASE_DEC, NULL, 0x0, + "Delay time between consecutive packet sends (100 us increments)", HFILL }}, + { &hf_ncp_burst_seqno, + { "Burst Sequence Number", "ncp.burst_seqno", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Sequence number of this packet in the burst", HFILL }}, + { &hf_ncp_ack_seqno, + { "ACK Sequence Number", "ncp.ack_seqno", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Next expected burst sequence number", HFILL }}, + { &hf_ncp_burst_len, + { "Burst Length", "ncp.burst_len", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Total length of data in this burst", HFILL }}, + { &hf_ncp_burst_offset, + { "Burst Offset", "ncp.burst_offset", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Offset of data in the burst", HFILL }}, + { &hf_ncp_data_offset, + { "Data Offset", "ncp.data_offset", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Offset of this packet", HFILL }}, + { &hf_ncp_data_bytes, + { "Data Bytes", "ncp.data_bytes", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Number of data bytes in this packet", HFILL }}, + { &hf_ncp_missing_fraglist_count, + { "Missing Fragment List Count", "ncp.missing_fraglist_count", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Number of missing fragments reported", HFILL }}, + { &hf_ncp_missing_data_offset, + { "Missing Data Offset", "ncp.missing_data_offset", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Offset of beginning of missing data", HFILL }}, + { &hf_ncp_missing_data_count, + { "Missing Data Count", "ncp.missing_data_count", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Number of bytes of missing data", HFILL }}, + { &hf_ncp_completion_code, + { "Completion Code", "ncp.completion_code", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_connection_status, + { "Connection Status", "ncp.connection_status", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_slot, + { "Slot", "ncp.slot", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_control_code, + { "Control Code", "ncp.control_code", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_fragment_handle, + { "Fragment Handle", "ncp.fragger_hndl", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + { &hf_lip_echo, + { "Large Internet Packet Echo", "ncp.lip_echo", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + { &hf_ncp_burst_command, + { "Burst Command", "ncp.burst_command", + FT_UINT32, BASE_HEX, VALS(burst_command), 0x0, + "Packet Burst Command", HFILL }}, + { &hf_ncp_burst_file_handle, + { "Burst File Handle", "ncp.file_handle", + FT_UINT32, BASE_HEX, NULL, 0x0, + "Packet Burst File Handle", HFILL }}, + { &hf_ncp_burst_reserved, + { "Reserved", "ncp.burst_reserved", + FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + + }; + static gint *ett[] = { + &ett_ncp, + &ett_ncp_system_flags, + &ett_nds, + &ett_nds_segments, + &ett_nds_segment, + }; + module_t *ncp_module; + + proto_ncp = proto_register_protocol("NetWare Core Protocol", "NCP", "ncp"); + proto_register_field_array(proto_ncp, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + + ncp_module = prefs_register_protocol(proto_ncp, NULL); + prefs_register_obsolete_preference(ncp_module, "initial_hash_size"); + prefs_register_bool_preference(ncp_module, "desegment", + "Reassemble NCP-over-TCP messages spanning multiple TCP segments", + "Whether the NCP dissector should reassemble messages spanning multiple TCP segments." + " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", + &ncp_desegment); + prefs_register_bool_preference(ncp_module, "defragment_nds", + "Reassemble fragmented NDS messages spanning multiple reply packets", + "Whether the NCP dissector should defragment NDS messages spanning multiple reply packets.", + &nds_defragment); + prefs_register_bool_preference(ncp_module, "newstyle", + "Dissect New Netware Information Structure", + "Dissect the NetWare Information Structure as NetWare 5.x or higher or as older NetWare 3.x.", + &ncp_newstyle); + prefs_register_bool_preference(ncp_module, "eid_2_expert", + "Expert: EID to Name lookups?", + "Whether the NCP dissector should echo the NDS Entry ID to name resolves to the expert table.", + &nds_echo_eid); + prefs_register_bool_preference(ncp_module, "connection_2_expert", + "Expert: NCP Connections?", + "Whether the NCP dissector should echo NCP connection information to the expert table.", + &ncp_echo_conn); + prefs_register_bool_preference(ncp_module, "error_2_expert", + "Expert: NCP Errors?", + "Whether the NCP dissector should echo protocol errors to the expert table.", + &ncp_echo_err); + prefs_register_bool_preference(ncp_module, "server_2_expert", + "Expert: Server Information?", + "Whether the NCP dissector should echo server information to the expert table.", + &ncp_echo_server); + prefs_register_bool_preference(ncp_module, "file_2_expert", + "Expert: File Information?", + "Whether the NCP dissector should echo file open/close/oplock information to the expert table.", + &ncp_echo_file); + register_init_routine(&mncp_init_protocol); + ncp_tap.stat=register_tap("ncp_srt"); + ncp_tap.hdr=register_tap("ncp_hdr"); + register_postseq_cleanup_routine(&mncp_postseq_cleanup); } void proto_reg_handoff_ncp(void) { - dissector_handle_t ncp_handle; - dissector_handle_t ncp_tcp_handle; + dissector_handle_t ncp_handle; + dissector_handle_t ncp_tcp_handle; - ncp_handle = create_dissector_handle(dissect_ncp, proto_ncp); - ncp_tcp_handle = create_dissector_handle(dissect_ncp_tcp, proto_ncp); - dissector_add("tcp.port", TCP_PORT_NCP, ncp_tcp_handle); - dissector_add("udp.port", UDP_PORT_NCP, ncp_handle); - dissector_add("ipx.packet_type", IPX_PACKET_TYPE_NCP, ncp_handle); - dissector_add("ipx.socket", IPX_SOCKET_NCP, ncp_handle); + ncp_handle = create_dissector_handle(dissect_ncp, proto_ncp); + ncp_tcp_handle = create_dissector_handle(dissect_ncp_tcp, proto_ncp); + dissector_add("tcp.port", TCP_PORT_NCP, ncp_tcp_handle); + dissector_add("udp.port", UDP_PORT_NCP, ncp_handle); + dissector_add("ipx.packet_type", IPX_PACKET_TYPE_NCP, ncp_handle); + dissector_add("ipx.socket", IPX_SOCKET_NCP, ncp_handle); - data_handle = find_dissector("data"); + data_handle = find_dissector("data"); } |