diff options
author | Bill Meier <wmeier@newsguy.com> | 2010-11-04 21:30:42 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2010-11-04 21:30:42 +0000 |
commit | b21ea034b699c9eea835fdd30a6f9bb87ec0b79c (patch) | |
tree | 2350102ebdbb2ed32dfed6af389361df7e71c7de /epan/dissectors | |
parent | 198ecea8961d5605a9ad3aa308088a620944a8de (diff) |
Use value_string_ext fcns to access certain value_string arrays;
Sort certain value_string arrays to be in ascending numeric order;
Do minor whitespace cleanup and reformatting of long lines.
svn path=/trunk/; revision=34780
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-afs.c | 241 | ||||
-rw-r--r-- | epan/dissectors/packet-cigi.c | 16 | ||||
-rw-r--r-- | epan/dissectors/packet-nfs.c | 148 | ||||
-rw-r--r-- | epan/dissectors/packet-wbxml.c | 3 |
4 files changed, 217 insertions, 191 deletions
diff --git a/epan/dissectors/packet-afs.c b/epan/dissectors/packet-afs.c index ca718fbd5a..32e6ae57ae 100644 --- a/epan/dissectors/packet-afs.c +++ b/epan/dissectors/packet-afs.c @@ -867,6 +867,7 @@ static const value_string fs_req[] = { { 65540, "get-capabilities" }, { 0, NULL }, }; +static value_string_ext fs_req_ext = VALUE_STRING_EXT_INIT(fs_req); static const value_string cb_req[] = { { 204, "callback" }, @@ -889,6 +890,7 @@ static const value_string cb_req[] = { { 65538, "get-capabilities" }, { 0, NULL }, }; +static value_string_ext cb_req_ext = VALUE_STRING_EXT_INIT(cb_req); static const value_string prot_req[] = { { 500, "new-user" }, @@ -915,6 +917,7 @@ static const value_string prot_req[] = { { 521, "list-entries" }, { 0, NULL }, }; +static value_string_ext prot_req_ext = VALUE_STRING_EXT_INIT(prot_req); static const value_string vldb_req[] = { { 501, "create-entry" }, @@ -953,14 +956,12 @@ static const value_string vldb_req[] = { { 534, "list-attrib-n2" }, { 0, NULL }, }; +static value_string_ext vldb_req_ext = VALUE_STRING_EXT_INIT(vldb_req); static const value_string kauth_req[] = { { 1, "auth-old" }, - { 21, "authenticate" }, - { 22, "authenticate-v2" }, { 2, "change-pw" }, { 3, "get-ticket-old" }, - { 23, "get-ticket" }, { 4, "set-pw" }, { 5, "set-fields" }, { 6, "create-user" }, @@ -973,8 +974,12 @@ static const value_string kauth_req[] = { { 13, "get-random-key" }, { 14, "unlock" }, { 15, "lock-status" }, + { 21, "authenticate" }, + { 22, "authenticate-v2" }, + { 23, "get-ticket" }, { 0, NULL }, }; +static value_string_ext kauth_req_ext = VALUE_STRING_EXT_INIT(kauth_req); static const value_string vol_req[] = { { 100, "create-volume" }, @@ -1010,6 +1015,7 @@ static const value_string vol_req[] = { { 65537, "getsize" }, { 0, NULL }, }; +static value_string_ext vol_req_ext = VALUE_STRING_EXT_INIT(vol_req); static const value_string bos_req[] = { { 80, "create-bnode" }, @@ -1051,18 +1057,21 @@ static const value_string bos_req[] = { { 116, "set restricted" }, { 0, NULL }, }; +static value_string_ext bos_req_ext = VALUE_STRING_EXT_INIT(bos_req); static const value_string update_req[] = { { 1, "fetch-file" }, { 2, "fetch-info" }, { 0, NULL }, }; +static value_string_ext update_req_ext = VALUE_STRING_EXT_INIT(update_req); static const value_string rmtsys_req[] = { { 1, "setpag" }, { 2, "pioctl" }, { 0, NULL }, }; +static value_string_ext rmtsys_req_ext = VALUE_STRING_EXT_INIT(rmtsys_req); static const value_string backup_req[] = { { 100, "perform-dump" }, @@ -1086,6 +1095,7 @@ static const value_string backup_req[] = { { 118, "delete-dump" }, { 0, NULL }, }; +static value_string_ext backup_req_ext = VALUE_STRING_EXT_INIT(backup_req); static const value_string ubik_req[] = { { 10000, "vote-beacon" }, @@ -1112,6 +1122,7 @@ static const value_string ubik_req[] = { { 20013, "disk-setversion" }, { 0, NULL }, }; +static value_string_ext ubik_req_ext = VALUE_STRING_EXT_INIT(ubik_req); static const value_string cb_types[] = { { CB_TYPE_EXCLUSIVE, "exclusive" }, @@ -1121,36 +1132,6 @@ static const value_string cb_types[] = { }; static const value_string afs_errors[] = { - /* VOL Errors */ - { 363520, "ID Exists"}, - { 363521, "IO Error"}, - { 363522, "Name Exists"}, - { 363523, "Create Failed"}, - { 363524, "Entry Not Found"}, - { 363525, "Empty"}, - { 363526, "Entry Deleted"}, - { 363527, "Bad Name"}, - { 363528, "Bad Index"}, - { 363529, "Bad Volume Type"}, - { 363530, "Bad Partition"}, - { 363531, "Bad Server"}, - { 363532, "Bad Replicate Server"}, - { 363533, "No Replicate Server"}, - { 363534, "Duplicate Replicate Server"}, - { 363535, "ReadWrite Volume Not Found"}, - { 363536, "Bad Reference Count"}, - { 363537, "Size Exceeded"}, - { 363538, "Bad Entry"}, - { 363539, "Bad Volume ID Bump"}, - { 363540, "Already has edit"}, - { 363541, "Entry Locked"}, - { 363542, "Bad Volume Operation"}, - { 363543, "Bad Rel Lock Type"}, - { 363544, "Rerelease"}, - { 363545, "Bad Server"}, - { 363546, "Permission Denied"}, - { 363547, "Out of Memory"}, - /* KAUTH Errors */ { 180480, "Database Inconsistent"}, { 180481, "Exists"}, @@ -1215,6 +1196,36 @@ static const value_string afs_errors[] = { { 267279, "Too many"}, { 267280, "No memory"}, + /* VOL Errors */ + { 363520, "ID Exists"}, + { 363521, "IO Error"}, + { 363522, "Name Exists"}, + { 363523, "Create Failed"}, + { 363524, "Entry Not Found"}, + { 363525, "Empty"}, + { 363526, "Entry Deleted"}, + { 363527, "Bad Name"}, + { 363528, "Bad Index"}, + { 363529, "Bad Volume Type"}, + { 363530, "Bad Partition"}, + { 363531, "Bad Server"}, + { 363532, "Bad Replicate Server"}, + { 363533, "No Replicate Server"}, + { 363534, "Duplicate Replicate Server"}, + { 363535, "ReadWrite Volume Not Found"}, + { 363536, "Bad Reference Count"}, + { 363537, "Size Exceeded"}, + { 363538, "Bad Entry"}, + { 363539, "Bad Volume ID Bump"}, + { 363540, "Already has edit"}, + { 363541, "Entry Locked"}, + { 363542, "Bad Volume Operation"}, + { 363543, "Bad Rel Lock Type"}, + { 363544, "Rerelease"}, + { 363545, "Bad Server"}, + { 363546, "Permission Denied"}, + { 363547, "Out of Memory"}, + /* Volume server errors */ { 1492325120, "Release error"}, { 1492325121, "No op"}, @@ -1238,36 +1249,39 @@ static const value_string afs_errors[] = { /* add more of these errors to decode the errcode responses */ { 0, NULL }, }; +static value_string_ext afs_errors_ext = VALUE_STRING_EXT_INIT(afs_errors); static const value_string port_types[] = { - { AFS_PORT_FS, "File Server" }, - { AFS_PORT_CB, "Callback Server" }, - { AFS_PORT_BOS, "BOS Server" }, - { AFS_PORT_PROT, "Protection Server" }, - { AFS_PORT_VLDB, "Volume Location Database Server" }, - { AFS_PORT_KAUTH, "Kerberos Authentication Server" }, - { AFS_PORT_ERROR, "Error Server" }, - { AFS_PORT_VOL, "Volume Server" }, - { AFS_PORT_RMTSYS, "Rmtsys? Server" }, + { AFS_PORT_FS, "File Server" }, + { AFS_PORT_CB, "Callback Server" }, + { AFS_PORT_PROT, "Protection Server" }, + { AFS_PORT_VLDB, "Volume Location Database Server" }, + { AFS_PORT_KAUTH, "Kerberos Authentication Server" }, + { AFS_PORT_VOL, "Volume Server" }, + { AFS_PORT_ERROR, "Error Server" }, + { AFS_PORT_BOS, "BOS Server" }, { AFS_PORT_UPDATE, "Update? Server" }, + { AFS_PORT_RMTSYS, "Rmtsys? Server" }, { AFS_PORT_BACKUP, "Backup Server" }, { 0, NULL } }; +static value_string_ext port_types_ext = VALUE_STRING_EXT_INIT(port_types); static const value_string port_types_short[] = { - { AFS_PORT_FS, "FS" }, - { AFS_PORT_CB, "CB" }, - { AFS_PORT_BOS, "BOS" }, - { AFS_PORT_PROT, "PROT" }, - { AFS_PORT_VLDB, "VLDB" }, - { AFS_PORT_KAUTH, "KAUTH" }, - { AFS_PORT_ERROR, "ERR" }, - { AFS_PORT_VOL, "VOL" }, - { AFS_PORT_RMTSYS, "RMT" }, + { AFS_PORT_FS, "FS" }, + { AFS_PORT_CB, "CB" }, + { AFS_PORT_PROT, "PROT" }, + { AFS_PORT_VLDB, "VLDB" }, + { AFS_PORT_KAUTH, "KAUTH" }, + { AFS_PORT_VOL, "VOL" }, + { AFS_PORT_ERROR, "ERR" }, + { AFS_PORT_BOS, "BOS" }, { AFS_PORT_UPDATE, "UPD" }, + { AFS_PORT_RMTSYS, "RMT" }, { AFS_PORT_BACKUP, "BKUP" }, { 0, NULL } }; +static value_string_ext port_types_short_ext = VALUE_STRING_EXT_INIT(port_types_short); static const value_string ubik_lock_types[] = { { 1, "read" }, @@ -1416,7 +1430,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *afs_tree, *afs_op_tree, *ti; proto_item *hidden_item; int port, node, typenode, opcode; - value_string const *vals; + value_string_ext *vals_ext; int offset = 0; nstime_t delta_ts; @@ -1481,43 +1495,43 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) node = 0; typenode = 0; - vals = NULL; + vals_ext = NULL; dissector = NULL; switch (port) { case AFS_PORT_FS: typenode = hf_afs_fs; node = hf_afs_fs_opcode; - vals = fs_req; + vals_ext = &fs_req_ext; dissector = reply ? dissect_fs_reply : dissect_fs_request; break; case AFS_PORT_CB: typenode = hf_afs_cb; node = hf_afs_cb_opcode; - vals = cb_req; + vals_ext = &cb_req_ext; dissector = reply ? dissect_cb_reply : dissect_cb_request; break; case AFS_PORT_PROT: typenode = hf_afs_prot; node = hf_afs_prot_opcode; - vals = prot_req; + vals_ext = &prot_req_ext; dissector = reply ? dissect_prot_reply : dissect_prot_request; break; case AFS_PORT_VLDB: typenode = hf_afs_vldb; node = hf_afs_vldb_opcode; - vals = vldb_req; + vals_ext = &vldb_req_ext; dissector = reply ? dissect_vldb_reply : dissect_vldb_request; break; case AFS_PORT_KAUTH: typenode = hf_afs_kauth; node = hf_afs_kauth_opcode; - vals = kauth_req; + vals_ext = &kauth_req_ext; dissector = reply ? dissect_kauth_reply : dissect_kauth_request; break; case AFS_PORT_VOL: typenode = hf_afs_vol; node = hf_afs_vol_opcode; - vals = vol_req; + vals_ext = &vol_req_ext; dissector = reply ? dissect_vol_reply : dissect_vol_request; break; case AFS_PORT_ERROR: @@ -1528,25 +1542,25 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case AFS_PORT_BOS: typenode = hf_afs_bos; node = hf_afs_bos_opcode; - vals = bos_req; + vals_ext = &bos_req_ext; dissector = reply ? dissect_bos_reply : dissect_bos_request; break; case AFS_PORT_UPDATE: typenode = hf_afs_update; node = hf_afs_update_opcode; - vals = update_req; + vals_ext = &update_req_ext; /* dissector = reply ? dissect_update_reply : dissect_update_request; */ break; case AFS_PORT_RMTSYS: typenode = hf_afs_rmtsys; node = hf_afs_rmtsys_opcode; - vals = rmtsys_req; + vals_ext = &rmtsys_req_ext; /* dissector = reply ? dissect_rmtsys_reply : dissect_rmtsys_request; */ break; case AFS_PORT_BACKUP: typenode = hf_afs_backup; node = hf_afs_backup_opcode; - vals = backup_req; + vals_ext = &backup_req_ext; dissector = reply ? dissect_backup_reply : dissect_backup_request; break; } @@ -1555,28 +1569,28 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) (opcode >= DISK_LOW && opcode <= DISK_HIGH) ) { typenode = hf_afs_ubik; node = hf_afs_ubik_opcode; - vals = ubik_req; + vals_ext = &ubik_req_ext; dissector = reply ? dissect_ubik_reply : dissect_ubik_request; } if ( VALID_OPCODE(opcode) ) { - if ( vals ) { + if ( vals_ext ) { col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s %s: %s (%d)", typenode == hf_afs_ubik ? "UBIK-" : "", - val_to_str(port, port_types_short, "Unknown(%d)"), + val_to_str_ext(port, &port_types_short_ext, "Unknown(%d)"), reply ? "Reply" : "Request", - val_to_str(opcode, vals, "Unknown(%d)"), opcode); + val_to_str_ext(opcode, vals_ext, "Unknown(%d)"), opcode); } else { col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s %s: Unknown(%d)", typenode == hf_afs_ubik ? "UBIK-" : "", - val_to_str(port, port_types_short, "Unknown(%d)"), + val_to_str_ext(port, &port_types_short_ext, "Unknown(%d)"), reply ? "Reply" : "Request", opcode); } } else { col_add_fstr(pinfo->cinfo, COL_INFO, "Encrypted %s %s", - val_to_str(port, port_types_short, "Unknown(%d)"), + val_to_str_ext(port, &port_types_short_ext, "Unknown(%d)"), reply ? "Reply" : "Request" ); } @@ -1590,7 +1604,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Service: %s%s%s %s", VALID_OPCODE(opcode) ? "" : "Encrypted ", typenode == hf_afs_ubik ? "UBIK - " : "", - val_to_str(port, port_types, "Unknown(%d)"), + val_to_str_ext(port, &port_types_ext, "Unknown(%d)"), reply ? "Reply" : "Request"); if( request_val && !reply && request_val->rep_num) { @@ -2992,71 +3006,64 @@ proto_register_afs(void) FT_BOOLEAN, BASE_NONE, 0, 0x0, "Backup Server", HFILL }}, { &hf_afs_fs_opcode, { "Operation", "afs.fs.opcode", - FT_UINT32, BASE_DEC, - VALS(fs_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &fs_req_ext, 0, NULL, HFILL }}, { &hf_afs_cb_opcode, { "Operation", "afs.cb.opcode", - FT_UINT32, BASE_DEC, - VALS(cb_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &cb_req_ext, 0, NULL, HFILL }}, { &hf_afs_prot_opcode, { "Operation", "afs.prot.opcode", - FT_UINT32, BASE_DEC, - VALS(prot_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &prot_req_ext, 0, NULL, HFILL }}, { &hf_afs_vldb_opcode, { "Operation", "afs.vldb.opcode", - FT_UINT32, BASE_DEC, - VALS(vldb_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &vldb_req_ext, 0, NULL, HFILL }}, { &hf_afs_kauth_opcode, { "Operation", "afs.kauth.opcode", - FT_UINT32, BASE_DEC, - VALS(kauth_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &kauth_req_ext, 0, NULL, HFILL }}, { &hf_afs_vol_opcode, { "Operation", "afs.vol.opcode", - FT_UINT32, BASE_DEC, - VALS(vol_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &vol_req_ext, 0, NULL, HFILL }}, { &hf_afs_bos_opcode, { "Operation", "afs.bos.opcode", - FT_UINT32, BASE_DEC, - VALS(bos_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &bos_req_ext, 0, NULL, HFILL }}, { &hf_afs_update_opcode, { "Operation", "afs.update.opcode", - FT_UINT32, BASE_DEC, - VALS(update_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &update_req_ext, 0, NULL, HFILL }}, { &hf_afs_rmtsys_opcode, { "Operation", "afs.rmtsys.opcode", - FT_UINT32, BASE_DEC, - VALS(rmtsys_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &rmtsys_req_ext, 0, NULL, HFILL }}, + { &hf_afs_error_opcode, { "Operation", "afs.error.opcode", - FT_UINT32, BASE_DEC, - 0, 0, NULL, HFILL }}, - { &hf_afs_backup_opcode, { - "Operation", "afs.backup.opcode", - FT_UINT32, BASE_DEC, - VALS(backup_req), 0, NULL, HFILL }}, - { &hf_afs_ubik_opcode, { - "Operation", "afs.ubik.opcode", - FT_UINT32, BASE_DEC, - VALS(ubik_req), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }}, + { &hf_afs_backup_opcode, { "Operation", "afs.backup.opcode", + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &backup_req_ext, 0, NULL, HFILL }}, + { &hf_afs_ubik_opcode, { "Operation", "afs.ubik.opcode", + FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &ubik_req_ext, 0, NULL, HFILL }}, /* File Server Fields */ { &hf_afs_fs_fid_volume, { "FileID (Volume)", "afs.fs.fid.volume", - FT_UINT32, BASE_DEC, - 0, 0, "File ID (Volume)", HFILL }}, + FT_UINT32, BASE_DEC, 0, 0, "File ID (Volume)", HFILL }}, { &hf_afs_fs_fid_vnode, { "FileID (VNode)", "afs.fs.fid.vnode", - FT_UINT32, BASE_DEC, - 0, 0, "File ID (VNode)", HFILL }}, + FT_UINT32, BASE_DEC, 0, 0, "File ID (VNode)", HFILL }}, { &hf_afs_fs_fid_uniqifier, { "FileID (Uniqifier)", "afs.fs.fid.uniq", - FT_UINT32, BASE_DEC, - 0, 0, "File ID (Uniqifier)", HFILL }}, + FT_UINT32, BASE_DEC, 0, 0, "File ID (Uniqifier)", HFILL }}, { &hf_afs_fs_offset, { "Offset", "afs.fs.offset", - FT_UINT32, BASE_DEC, - 0, 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }}, { &hf_afs_fs_length, { "Length", "afs.fs.length", FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }}, { &hf_afs_fs_flength, { "FLength", "afs.fs.flength", FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }}, { &hf_afs_fs_offset64, { "Offset64", "afs.fs.offset64", - FT_UINT64, BASE_DEC, - 0, 0, NULL, HFILL }}, + FT_UINT64, BASE_DEC, 0, 0, NULL, HFILL }}, { &hf_afs_fs_length64, { "Length64", "afs.fs.length64", FT_UINT64, BASE_DEC, 0, 0, NULL, HFILL }}, { &hf_afs_fs_flength64, { "FLength64", "afs.fs.flength64", FT_UINT64, BASE_DEC, 0, 0, NULL, HFILL }}, { &hf_afs_fs_errcode, { "Error Code", "afs.fs.errcode", - FT_UINT32, BASE_DEC, VALS(afs_errors), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }}, { &hf_afs_fs_data, { "Data", "afs.fs.data", FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL }}, { &hf_afs_fs_token, { "Token", "afs.fs.token", @@ -3215,7 +3222,7 @@ proto_register_afs(void) /* BOS Server Fields */ { &hf_afs_bos_errcode, { "Error Code", "afs.bos.errcode", - FT_UINT32, BASE_DEC, VALS(afs_errors), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }}, { &hf_afs_bos_type, { "Type", "afs.bos.type", FT_STRING, BASE_NONE, 0, 0, NULL, HFILL }}, { &hf_afs_bos_content, { "Content", "afs.bos.content", @@ -3278,7 +3285,7 @@ proto_register_afs(void) /* KAUTH Server Fields */ { &hf_afs_kauth_errcode, { "Error Code", "afs.kauth.errcode", - FT_UINT32, BASE_DEC, VALS(afs_errors), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }}, { &hf_afs_kauth_princ, { "Principal", "afs.kauth.princ", FT_STRING, BASE_NONE, 0, 0, NULL, HFILL }}, { &hf_afs_kauth_realm, { "Realm", "afs.kauth.realm", @@ -3294,7 +3301,7 @@ proto_register_afs(void) /* VOL Server Fields */ { &hf_afs_vol_errcode, { "Error Code", "afs.vol.errcode", - FT_UINT32, BASE_DEC, VALS(afs_errors), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }}, { &hf_afs_vol_id, { "Volume ID", "afs.vol.id", FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }}, { &hf_afs_vol_count, { "Volume Count", "afs.vol.count", @@ -3304,7 +3311,7 @@ proto_register_afs(void) /* VLDB Server Fields */ { &hf_afs_vldb_errcode, { "Error Code", "afs.vldb.errcode", - FT_UINT32, BASE_DEC, VALS(afs_errors), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }}, { &hf_afs_vldb_type, { "Volume Type", "afs.vldb.type", FT_UINT32, BASE_HEX, VALS(volume_types), 0, NULL, HFILL }}, { &hf_afs_vldb_id, { "Volume ID", "afs.vldb.id", @@ -3374,11 +3381,11 @@ proto_register_afs(void) /* BACKUP Server Fields */ { &hf_afs_backup_errcode, { "Error Code", "afs.backup.errcode", - FT_UINT32, BASE_DEC, VALS(afs_errors), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }}, /* CB Server Fields */ { &hf_afs_cb_errcode, { "Error Code", "afs.cb.errcode", - FT_UINT32, BASE_DEC, VALS(afs_errors), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }}, { &hf_afs_cb_callback_version, { "Version", "afs.cb.callback.version", FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }}, { &hf_afs_cb_callback_expires, { "Expires", "afs.cb.callback.expires", @@ -3394,7 +3401,7 @@ proto_register_afs(void) /* PROT Server Fields */ { &hf_afs_prot_errcode, { "Error Code", "afs.prot.errcode", - FT_UINT32, BASE_DEC, VALS(afs_errors), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }}, { &hf_afs_prot_name, { "Name", "afs.prot.name", FT_STRING, BASE_NONE, 0, 0, NULL, HFILL }}, { &hf_afs_prot_id, { "ID", "afs.prot.id", @@ -3420,7 +3427,7 @@ proto_register_afs(void) /* UBIK Fields */ { &hf_afs_ubik_errcode, { "Error Code", "afs.ubik.errcode", - FT_UINT32, BASE_DEC, VALS(afs_errors), 0, NULL, HFILL }}, + FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }}, { &hf_afs_ubik_state, { "State", "afs.ubik.state", FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }}, { &hf_afs_ubik_version_epoch, { "Epoch", "afs.ubik.version.epoch", diff --git a/epan/dissectors/packet-cigi.c b/epan/dissectors/packet-cigi.c index abb5ff93b0..ece83f9510 100644 --- a/epan/dissectors/packet-cigi.c +++ b/epan/dissectors/packet-cigi.c @@ -262,6 +262,7 @@ static const value_string cigi2_packet_id_vals[] = { {CIGI2_PACKET_ID_USER_DEFINABLE_MAX, "User Definable"}, {0, NULL}, }; +static value_string_ext cigi2_packet_id_vals_ext = VALUE_STRING_EXT_INIT(cigi2_packet_id_vals); /* CIGI2 IG Control */ #define CIGI2_PACKET_SIZE_IG_CONTROL 16 @@ -887,6 +888,7 @@ static const value_string cigi3_packet_id_vals[] = { {CIGI3_PACKET_ID_USER_DEFINED_MAX, "User-Defined Data"}, {0, NULL}, }; +static value_string_ext cigi3_packet_id_vals_ext = VALUE_STRING_EXT_INIT(cigi3_packet_id_vals); /* CIGI3 IG Control */ #define CIGI3_PACKET_SIZE_IG_CONTROL 16 @@ -2898,7 +2900,10 @@ cigi2_add_tree(tvbuff_t *tvb, proto_tree *cigi_tree) hf_cigi2_packet = hf_cigi_unknown; packet_length = packet_size; } - tipacket = proto_tree_add_string_format(cigi_tree, hf_cigi2_packet, tvb, offset, packet_length, NULL, "%s (%i bytes)", val_to_str(packet_id, cigi2_packet_id_vals, "Unknown"), packet_length); + tipacket = proto_tree_add_string_format(cigi_tree, hf_cigi2_packet, tvb, offset, packet_length, NULL, + "%s (%i bytes)", + val_to_str_ext_const(packet_id, &cigi2_packet_id_vals_ext, "Unknown"), + packet_length); cigi_packet_tree = proto_item_add_subtree(tipacket, ett_cigi); @@ -3203,7 +3208,10 @@ cigi3_add_tree(tvbuff_t *tvb, proto_tree *cigi_tree) hf_cigi3_packet = hf_cigi_unknown; packet_length = packet_size; } - tipacket = proto_tree_add_string_format(cigi_tree, hf_cigi3_packet, tvb, offset, packet_length, NULL, "%s (%i bytes)", val_to_str(packet_id, cigi3_packet_id_vals, "Unknown"), packet_length); + tipacket = proto_tree_add_string_format(cigi_tree, hf_cigi3_packet, tvb, offset, packet_length, NULL, + "%s (%i bytes)", + val_to_str_ext_const(packet_id, &cigi3_packet_id_vals_ext, "Unknown"), + packet_length); cigi_packet_tree = proto_item_add_subtree(tipacket, ett_cigi); @@ -6441,14 +6449,14 @@ proto_register_cigi(void) /* CIGI2 */ { &hf_cigi2_packet_id, { "Packet ID", "cigi.packet_id", - FT_UINT8, BASE_DEC, VALS(cigi2_packet_id_vals), 0x0, + FT_UINT8, BASE_DEC|BASE_EXT_STRING, &cigi2_packet_id_vals_ext, 0x0, "Identifies the packet's ID", HFILL } }, /* CIGI3 */ { &hf_cigi3_packet_id, { "Packet ID", "cigi.packet_id", - FT_UINT8, BASE_DEC, VALS(cigi3_packet_id_vals), 0x0, + FT_UINT8, BASE_DEC|BASE_EXT_STRING, &cigi3_packet_id_vals_ext, 0x0, "Identifies the packet's ID", HFILL } }, { &hf_cigi3_byte_swap, diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 2d0c165036..69377d3c11 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -1204,6 +1204,7 @@ static const value_string names_fhtype[] = { FHT_CELERRA, "Celerra nfs file handle" }, { 0, NULL } }; +static value_string_ext names_fhtype_ext = VALUE_STRING_EXT_INIT(names_fhtype); static const true_false_string tfs_endianness = { "Little Endian", "Big Endian" }; @@ -2367,7 +2368,7 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, int real_length; proto_tree_add_text(tree, tvb, offset, 0, - "decode type as: %s", val_to_str(default_nfs_fhandle_type, names_fhtype, "Unknown")); + "decode type as: %s", val_to_str_ext_const(default_nfs_fhandle_type, &names_fhtype_ext, "Unknown")); real_length=fhlen; @@ -2477,6 +2478,7 @@ static const value_string names_nfs_stat[] = { 10049, "NFSERR_REPLAY_ME" }, { 0, NULL } }; +static value_string_ext names_nfs_stat_ext = VALUE_STRING_EXT_INIT(names_nfs_stat); /* RFC 1094, Page 12..14 */ static int @@ -2517,7 +2519,7 @@ dissect_nfs2_rmdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, prot proto_item_append_text(tree, ", RMDIR Reply"); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", RMDIR Reply Error:%s", err); } @@ -2537,7 +2539,7 @@ dissect_nfs2_symlink_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, pr proto_item_append_text(tree, ", SYMLINK Reply"); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", SYMLINK Reply Error:%s", err); } @@ -2557,7 +2559,7 @@ dissect_nfs2_link_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto proto_item_append_text(tree, ", LINK Reply"); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", LINK Reply Error:%s", err); } @@ -2577,7 +2579,7 @@ dissect_nfs2_rename_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, pro proto_item_append_text(tree, ", RENAME Reply"); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", RENAME Reply Error:%s", err); } @@ -2597,7 +2599,7 @@ dissect_nfs2_remove_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, pro proto_item_append_text(tree, ", REMOVE Reply"); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", REMOVE Reply Error:%s", err); } @@ -2617,6 +2619,7 @@ static const value_string nfs2_ftype[] = { 5, "Symbolic Link" }, { 0, NULL } }; +static value_string_ext nfs2_ftype_ext = VALUE_STRING_EXT_INIT(nfs2_ftype); static int dissect_ftype(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name) @@ -2627,7 +2630,7 @@ dissect_ftype(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name) ftype = tvb_get_ntohl(tvb, offset+0); if (tree) { - ftype_name_p = val_to_str(ftype, nfs2_ftype, "%u"); + ftype_name_p = val_to_str_ext(ftype, &nfs2_ftype_ext, "%u"); proto_tree_add_text(tree, tvb, offset, 4, "%s: %s (%u)", name, ftype_name_p, ftype); @@ -2957,7 +2960,7 @@ dissect_attrstat(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo proto_item_append_text(tree, ", %s Reply", funcname); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", %s Reply Error:%s", funcname, err); break; @@ -3097,7 +3100,7 @@ dissect_diropres(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_item_append_text(tree, ", %s Reply FH:0x%08x", funcname, hash); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", %s Reply Error:%s", funcname, err); break; @@ -3175,7 +3178,7 @@ dissect_nfs2_readlink_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_item_append_text(tree, ", READLINK Reply Path:%s", name); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", READLINK Reply Error:%s", err); break; @@ -3232,7 +3235,7 @@ dissect_nfs2_read_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_data); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", READ Reply Error:%s", err); break; @@ -3462,7 +3465,7 @@ dissect_nfs2_readdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, offset += 4; break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", READDIR Reply Error:%s", err); break; @@ -3509,7 +3512,7 @@ dissect_nfs2_statfs_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_item_append_text(tree, ", STATFS Reply"); break; default: - err=val_to_str(status, names_nfs_stat, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_stat_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", STATFS Reply Error:%s", err); break; @@ -3706,6 +3709,7 @@ static const value_string names_nfs_nfsstat3[] = { 10008, "NFS3ERR_JUKEBOX" }, { 0, NULL } }; +static value_string_ext names_nfs_nfsstat3_ext = VALUE_STRING_EXT_INIT(names_nfs_nfsstat3); /* RFC 1813, Page 16 */ @@ -3742,6 +3746,7 @@ static const value_string names_nfs_ftype3[] = { NF3FIFO,"Named Pipe" }, { 0, NULL } }; +static value_string_ext names_nfs_ftype3_ext = VALUE_STRING_EXT_INIT(names_nfs_ftype3); /* RFC 1813, Page 20 */ @@ -3978,13 +3983,13 @@ dissect_nfs_fattr3(packet_info *pinfo, tvbuff_t *tvb, int offset, levels&=(~COL_INFO_LEVEL); col_append_fstr(pinfo->cinfo, COL_INFO, " %s mode:%04o uid:%d gid:%d", - val_to_str(type, names_nfs_ftype3,"Unknown Type:0x%x"), + val_to_str_ext(type, &names_nfs_ftype3_ext,"Unknown Type:0x%x"), mode&0x0fff, uid, gid); } /* populate the expansion lines with some nice useable info */ while( fattr3_tree && levels-- ){ proto_item_append_text(fattr3_tree, " %s mode:%04o uid:%d gid:%d", - val_to_str(type, names_nfs_ftype3,"Unknown Type:0x%x"), + val_to_str_ext(type, &names_nfs_ftype3_ext,"Unknown Type:0x%x"), mode&0x0fff, uid, gid); fattr3_tree=fattr3_tree->parent; } @@ -4021,7 +4026,7 @@ dissect_nfs_post_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr attributes_follow = tvb_get_ntohl(tvb, offset+0); proto_tree_add_text(post_op_attr_tree, tvb, offset, 4, "attributes_follow: %s (%u)", - val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow); + val_to_str_const(attributes_follow,value_follows,"Unknown"), attributes_follow); offset += 4; switch (attributes_follow) { case TRUE: @@ -4090,7 +4095,7 @@ dissect_pre_op_attr(tvbuff_t *tvb, int offset, proto_tree *tree, const char* nam attributes_follow = tvb_get_ntohl(tvb, offset+0); proto_tree_add_text(pre_op_attr_tree, tvb, offset, 4, "attributes_follow: %s (%u)", - val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow); + val_to_str_const(attributes_follow,value_follows,"Unknown"), attributes_follow); offset += 4; switch (attributes_follow) { case TRUE: @@ -4158,7 +4163,7 @@ dissect_post_op_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo, handle_follows = tvb_get_ntohl(tvb, offset+0); proto_tree_add_text(post_op_fh3_tree, tvb, offset, 4, "handle_follows: %s (%u)", - val_to_str(handle_follows,value_follows,"Unknown"), handle_follows); + val_to_str_const(handle_follows,value_follows,"Unknown"), handle_follows); offset += 4; switch (handle_follows) { case TRUE: @@ -4192,7 +4197,7 @@ dissect_set_mode3(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name) set_it = tvb_get_ntohl(tvb, offset+0); if (tree) { - set_it_name = val_to_str(set_it,value_follows,"Unknown"); + set_it_name = val_to_str_const(set_it,value_follows,"Unknown"); set_mode3_item = proto_tree_add_text(tree, tvb, offset, -1, "%s: %s", name, set_it_name); @@ -4237,7 +4242,7 @@ dissect_set_uid3(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name) set_it = tvb_get_ntohl(tvb, offset+0); if (tree) { - set_it_name = val_to_str(set_it,value_follows,"Unknown"); + set_it_name = val_to_str_const(set_it,value_follows,"Unknown"); set_uid3_item = proto_tree_add_text(tree, tvb, offset, -1, "%s: %s", name, set_it_name); @@ -4281,7 +4286,7 @@ dissect_set_gid3(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name) set_it = tvb_get_ntohl(tvb, offset+0); if (tree) { - set_it_name = val_to_str(set_it,value_follows,"Unknown"); + set_it_name = val_to_str_const(set_it,value_follows,"Unknown"); set_gid3_item = proto_tree_add_text(tree, tvb, offset, -1, "%s: %s", name, set_it_name); set_gid3_tree = proto_item_add_subtree(set_gid3_item, @@ -4324,7 +4329,7 @@ dissect_set_size3(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name) set_it = tvb_get_ntohl(tvb, offset+0); if (tree) { - set_it_name = val_to_str(set_it,value_follows,"Unknown"); + set_it_name = val_to_str_const(set_it,value_follows,"Unknown"); set_size3_item = proto_tree_add_text(tree, tvb, offset, -1, "%s: %s", name, set_it_name); @@ -4382,7 +4387,7 @@ dissect_set_atime(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name) set_it = tvb_get_ntohl(tvb, offset+0); if (tree) { - set_it_name = val_to_str(set_it,time_how,"Unknown"); + set_it_name = val_to_str_const(set_it,time_how,"Unknown"); set_atime_item = proto_tree_add_text(tree, tvb, offset, -1, "%s: %s", name, set_it_name); @@ -4428,7 +4433,7 @@ dissect_set_mtime(tvbuff_t *tvb, int offset, proto_tree *tree, const char* name) set_it = tvb_get_ntohl(tvb, offset+0); if (tree) { - set_it_name = val_to_str(set_it,time_how,"Unknown"); + set_it_name = val_to_str_const(set_it,time_how,"Unknown"); set_mtime_item = proto_tree_add_text(tree, tvb, offset, -1, "%s: %s", name, set_it_name); @@ -4625,7 +4630,7 @@ dissect_nfs3_getattr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, offset = dissect_nfs_fattr3(pinfo, tvb, offset, tree, "obj_attributes",2|COL_INFO_LEVEL); break; default: - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, " Error:%s", err); break; @@ -4648,7 +4653,7 @@ dissect_sattrguard3(tvbuff_t *tvb, int offset, proto_tree* tree, const char *nam check = tvb_get_ntohl(tvb, offset+0); if (tree) { - check_name = val_to_str(check,value_follows,"Unknown"); + check_name = val_to_str_const(check,value_follows,"Unknown"); sattrguard3_item = proto_tree_add_text(tree, tvb, offset, -1, "%s: %s", name, check_name); @@ -4716,7 +4721,7 @@ dissect_nfs3_setattr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, default: offset = dissect_wcc_data(tvb, offset, pinfo, tree, "obj_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", SETATTR Reply Error:%s", err); break; @@ -4768,7 +4773,7 @@ dissect_nfs3_lookup_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_nfs_post_op_attr(tvb, offset, pinfo, tree, "dir_attributes"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", LOOKUP Reply Error:%s", err); break; @@ -5007,7 +5012,7 @@ dissect_nfs3_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_item_append_text(tree, ", ACCESS Reply"); offset = dissect_access_reply(tvb, offset, pinfo, tree, 3, NULL); } else { - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error: %s", err); proto_item_append_text(tree, ", ACCESS Reply Error: %s", err); } @@ -5052,7 +5057,7 @@ dissect_nfs3_readlink_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, offset = dissect_nfs_post_op_attr(tvb, offset, pinfo, tree, "symlink_attributes"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", READLINK Reply Error:%s", err); break; @@ -5114,7 +5119,7 @@ dissect_nfs3_read_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, offset = dissect_nfs_post_op_attr(tvb, offset, pinfo, tree, "file_attributes"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", READ Reply Error:%s", err); break; @@ -5208,7 +5213,7 @@ dissect_nfs3_write_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, default: offset = dissect_wcc_data(tvb, offset, pinfo, tree, "file_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", WRITE Reply Error:%s", err); break; @@ -5293,7 +5298,7 @@ dissect_nfs3_create_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, default: offset = dissect_wcc_data(tvb, offset, pinfo, tree, "dir_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", CREATE Reply Error:%s", err); break; @@ -5339,7 +5344,7 @@ dissect_nfs3_mkdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, default: offset = dissect_wcc_data(tvb, offset, pinfo, tree, "dir_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", MKDIR Reply Error:%s", err); break; @@ -5386,7 +5391,7 @@ dissect_nfs3_symlink_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, default: offset = dissect_wcc_data(tvb, offset, pinfo, tree, "dir_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", SYMLINK Reply Error:%s", err); break; @@ -5423,7 +5428,7 @@ dissect_nfs3_mknod_call(tvbuff_t *tvb, int offset, packet_info *pinfo, break; } - type_str=val_to_str(type, names_nfs_ftype3, "Unknown type:%u"); + type_str=val_to_str_ext(type, &names_nfs_ftype3_ext, "Unknown type:%u"); col_append_fstr(pinfo->cinfo, COL_INFO,", FH:0x%08x/%s %s", hash, name, type_str); proto_item_append_text(tree, ", MKNOD Call FH:0x%08x/%s %s", hash, name, type_str); @@ -5448,7 +5453,7 @@ dissect_nfs3_mknod_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, default: offset = dissect_wcc_data(tvb, offset, pinfo, tree, "dir_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", MKNOD Reply Error:%s", err); break; @@ -5474,7 +5479,7 @@ dissect_nfs3_remove_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, break; default: offset = dissect_wcc_data(tvb, offset, pinfo, tree, "dir_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", REMOVE Reply Error:%s", err); break; @@ -5497,7 +5502,7 @@ dissect_nfs3_rmdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, break; default: offset = dissect_wcc_data(tvb, offset, pinfo, tree, "dir_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", RMDIR Reply Error:%s", err); break; @@ -5546,7 +5551,7 @@ dissect_nfs3_rename_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, offset = dissect_wcc_data(tvb, offset, pinfo, tree, "fromdir_wcc"); offset = dissect_wcc_data(tvb, offset, pinfo, tree, "todir_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", RENAME Reply Error:%s", err); break; @@ -5596,7 +5601,7 @@ dissect_nfs3_link_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, "file_attributes"); offset = dissect_wcc_data(tvb, offset, pinfo, tree, "linkdir_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", LINK Reply Error:%s", err); break; @@ -5692,7 +5697,7 @@ dissect_nfs3_readdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_nfs_post_op_attr(tvb, offset, pinfo, tree, "dir_attributes"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", READDIR Reply Error:%s", err); break; @@ -5812,7 +5817,7 @@ dissect_nfs3_readdirplus_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_nfs_post_op_attr(tvb, offset, pinfo, tree, "dir_attributes"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", READDIRPLUS Reply Error:%s", err); break; @@ -5874,7 +5879,7 @@ dissect_nfs3_fsstat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, offset = dissect_nfs_post_op_attr(tvb, offset, pinfo, tree, "obj_attributes"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", FSSTAT Reply Error:%s", err); break; @@ -6009,7 +6014,7 @@ dissect_nfs3_fsinfo_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, offset = dissect_nfs_post_op_attr(tvb, offset, pinfo, tree, "obj_attributes"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", FSINFO Reply Error:%s", err); break; @@ -6071,7 +6076,7 @@ dissect_nfs3_pathconf_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, offset = dissect_nfs_post_op_attr(tvb, offset, pinfo, tree, "obj_attributes"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", PATHCONF Reply Error:%s", err); break; @@ -6118,7 +6123,7 @@ dissect_nfs3_commit_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, default: offset = dissect_wcc_data(tvb, offset, pinfo, tree, "file_wcc"); - err=val_to_str(status, names_nfs_nfsstat3, "Unknown error:%u"); + err=val_to_str_ext(status, &names_nfs_nfsstat3_ext, "Unknown error:%u"); col_append_fstr(pinfo->cinfo, COL_INFO," Error:%s", err); proto_item_append_text(tree, ", COMMIT Reply Error:%s", err); break; @@ -6240,6 +6245,7 @@ static const value_string names_nfs_nfsstat4[] = { { 10086, "NFS4ERR_RETURNCONFLICT" }, { 0, NULL } }; +static value_string_ext names_nfs_nfsstat4_ext = VALUE_STRING_EXT_INIT(names_nfs_nfsstat4); static int @@ -8067,6 +8073,7 @@ static const value_string names_nfsv4_operation[] = { { NFS4_OP_ILLEGAL, "ILLEGAL" }, { 0, NULL } }; +static value_string_ext names_nfsv4_operation_ext = VALUE_STRING_EXT_INIT(names_nfsv4_operation); static gint *nfsv4_operation_ett[] = { @@ -8990,11 +8997,12 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo, break; } - opname=val_to_str(opcode, names_nfsv4_operation, "Unknown"); + opname=val_to_str_ext_const(opcode, &names_nfsv4_operation_ext, "Unknown"); offset += 4; g_string_append_printf (op_summary[ops_counter].optext, "%s", opname); - g_string_printf (op_summary[ops_counter].optext, "%s", val_to_str(opcode, names_nfsv4_operation, "Unknown")); + g_string_printf (op_summary[ops_counter].optext, "%s", + val_to_str_ext_const(opcode, &names_nfsv4_operation_ext, "Unknown")); switch(opcode) @@ -9507,7 +9515,7 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo, const char *main_opname=NULL; /* Display a filterable field of the most significant operations in all cases. */ - main_opname=val_to_str(main_opcode, names_nfsv4_operation, "Unknown"); + main_opname=val_to_str_ext_const(main_opcode, &names_nfsv4_operation_ext, "Unknown"); main_op_item=proto_tree_add_uint(ftree, hf_nfs_main_opcode, tvb, 0, 0, main_opcode); PROTO_ITEM_SET_GENERATED(main_op_item); @@ -9641,7 +9649,7 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo, break; } - opname=val_to_str(opcode, names_nfsv4_operation, "Unknown"); + opname=val_to_str_ext_const(opcode, &names_nfsv4_operation_ext, "Unknown"); offset += 4; g_string_append_printf (op_summary[ops_counter].optext, "%s", opname); @@ -9919,7 +9927,7 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo, const char *main_opname=NULL; /* Display a filterable field of the most significant operations in all cases. */ - main_opname=val_to_str(main_opcode, names_nfsv4_operation, "Unknown"); + main_opname=val_to_str_ext_const(main_opcode, &names_nfsv4_operation_ext, "Unknown"); main_op_item=proto_tree_add_uint(ftree, hf_nfs_main_opcode, tvb, 0, 0, main_opcode); } @@ -9955,7 +9963,8 @@ dissect_nfs4_compound_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_nfs_resop4(tvb, offset, pinfo, tree); if (status != NFS4_OK) - col_append_fstr(pinfo->cinfo, COL_INFO," Status: %s", val_to_str(status, names_nfs_nfsstat4, "Unknown error:%u")); + col_append_fstr(pinfo->cinfo, COL_INFO," Status: %s", + val_to_str_ext(status, &names_nfs_nfsstat4_ext, "Unknown error:%u")); return offset; } @@ -10229,6 +10238,7 @@ static const value_string names_nfs_cb_operation[] = { { NFS4_OP_CB_ILLEGAL, "CB_ILLEGAL"}, { 0, NULL } }; +static value_string_ext names_nfs_cb_operation_ext = VALUE_STRING_EXT_INIT(names_nfs_cb_operation); static gint *nfs_cb_operation_ett[] = { @@ -10325,7 +10335,7 @@ dissect_nfs_cb_argop(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * { opcode = tvb_get_ntohl(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, "%c%s", ops_counter==0?' ':';', - val_to_str(opcode, names_nfs_cb_operation, "Unknown")); + val_to_str_ext_const(opcode, &names_nfs_cb_operation_ext, "Unknown")); fitem = proto_tree_add_uint(ftree, hf_nfs_cb_op, tvb, offset, 4, opcode); offset += 4; @@ -10426,7 +10436,7 @@ dissect_nfs_cb_resop(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * break; col_append_fstr(pinfo->cinfo, COL_INFO, "%c%s", ops_counter==0?' ':';', - val_to_str(opcode, names_nfs_cb_operation, "Unknown")); + val_to_str_ext_const(opcode, &names_nfs_cb_operation_ext, "Unknown")); fitem = proto_tree_add_uint(ftree, hf_nfs_cb_op, tvb, offset, 4, opcode); offset += 4; @@ -10753,8 +10763,8 @@ proto_register_nfs(void) "endianness", "nfs.fh.endianness", FT_BOOLEAN, BASE_NONE, TFS(&tfs_endianness), 0x0, "server native endianness", HFILL }}, { &hf_nfs_stat, { - "Status", "nfs.stat", FT_UINT32, BASE_DEC, - VALS(names_nfs_stat), 0, "Reply status", HFILL }}, + "Status", "nfs.stat", FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &names_nfs_stat_ext, 0, "Reply status", HFILL }}, { &hf_nfs_full_name, { "Full Name", "nfs.full_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, @@ -10861,11 +10871,11 @@ proto_register_nfs(void) "Available Blocks", "nfs.statfs.bavail", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_nfs_ftype3, { - "Type", "nfs.type", FT_UINT32, BASE_DEC, - VALS(names_nfs_ftype3), 0, "File Type", HFILL }}, + "Type", "nfs.type", FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &names_nfs_ftype3_ext, 0, "File Type", HFILL }}, { &hf_nfs_nfsstat3, { - "Status", "nfs.nfsstat3", FT_UINT32, BASE_DEC, - VALS(names_nfs_nfsstat3), 0, "Reply status", HFILL }}, + "Status", "nfs.nfsstat3", FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &names_nfs_nfsstat3_ext, 0, "Reply status", HFILL }}, { &hf_nfs_read_eof, { "EOF", "nfs.read.eof", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0, NULL, HFILL }}, @@ -10968,8 +10978,8 @@ proto_register_nfs(void) NULL, 0, NULL, HFILL }}, { &hf_nfs_fattr3_type, { - "Type", "nfs.fattr3.type", FT_UINT32, BASE_DEC, - VALS(names_nfs_ftype3), 0, NULL, HFILL }}, + "Type", "nfs.fattr3.type", FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &names_nfs_ftype3_ext, 0, NULL, HFILL }}, { &hf_nfs_fattr3_nlink, { "nlink", "nfs.fattr3.nlink", FT_UINT32, BASE_DEC, @@ -11066,12 +11076,12 @@ proto_register_nfs(void) /* NFSv4 */ { &hf_nfs_nfsstat4, { - "Status", "nfs.nfsstat4", FT_UINT32, BASE_DEC, - VALS(names_nfs_nfsstat4), 0, "Reply status", HFILL }}, + "Status", "nfs.nfsstat4", FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &names_nfs_nfsstat4_ext, 0, "Reply status", HFILL }}, { &hf_nfs_op4, { - "Opcode", "nfs.opcode", FT_UINT32, BASE_DEC, - VALS(names_nfsv4_operation), 0, NULL, HFILL }}, + "Opcode", "nfs.opcode", FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &names_nfsv4_operation_ext, 0, NULL, HFILL }}, { &hf_nfs_main_opcode, { "Main Opcode", "nfs.main_opcode", FT_UINT32, BASE_DEC, @@ -12068,8 +12078,8 @@ proto_register_nfs(void) "CB Procedure", "nfs.cb_procedure", FT_UINT32, BASE_DEC, VALS(nfs_cb_proc_vals), 0, NULL, HFILL }}, { &hf_nfs_cb_op, { - "Opcode", "nfs.cb.operation", FT_UINT32, BASE_DEC, - VALS(names_nfs_cb_operation), 0, NULL, HFILL }}, + "Opcode", "nfs.cb.operation", FT_UINT32, BASE_DEC|BASE_EXT_STRING, + &names_nfs_cb_operation_ext, 0, NULL, HFILL }}, { &hf_nfs_lrs_present, { "Stateid present?", "nfs.lrs_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0, NULL, HFILL }}, diff --git a/epan/dissectors/packet-wbxml.c b/epan/dissectors/packet-wbxml.c index 44c367475e..e861d5ec85 100644 --- a/epan/dissectors/packet-wbxml.c +++ b/epan/dissectors/packet-wbxml.c @@ -4915,6 +4915,7 @@ static const value_string vals_wv_csp_11_element_value_tokens[] = { { 0x00, NULL } }; +static value_string_ext vals_wv_csp_11_element_value_tokens_ext = VALUE_STRING_EXT_INIT(vals_wv_csp_11_element_value_tokens); /***** Token code page aggregation *****/ @@ -4923,7 +4924,7 @@ static char * ext_t_0_wv_cspc_11(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_) { char *str = g_strdup_printf("Common Value: '%s'", - val_to_str(value, vals_wv_csp_11_element_value_tokens, + val_to_str_ext(value, &vals_wv_csp_11_element_value_tokens_ext, "<Unknown WV-CSP 1.1 Common Value token 0x%X>")); return str; } |