Register the "samr.nt_password" preference as obsolete.

svn path=/trunk/; revision=23794
This commit is contained in:
Gerald Combs 2007-12-07 18:50:41 +00:00
parent fcadd9d59f
commit be6e31fa44
2 changed files with 39 additions and 28 deletions

View File

@ -680,6 +680,8 @@ dcerpc_init_uuid (int proto, int ett, e_uuid_t *uuid, guint16 ver,
dcerpc_uuid_key *key = g_malloc (sizeof (*key));
dcerpc_uuid_value *value = g_malloc (sizeof (*value));
header_field_info *hf_info;
module_t *samr_module;
const char *filter_name = proto_get_protocol_filter_name(proto);
key->uuid = *uuid;
key->ver = ver;
@ -698,6 +700,13 @@ dcerpc_init_uuid (int proto, int ett, e_uuid_t *uuid, guint16 ver,
/* add this GUID to the global name resolving */
guids_add_uuid(uuid, proto_get_protocol_short_name (value->proto));
/* Register the samr.nt_password preference as obsolete */
/* This should be in packet-dcerpc-samr.c */
if (strcmp(filter_name, "samr") == 0) {
samr_module = prefs_register_protocol (proto, NULL);
prefs_register_obsolete_preference(samr_module, "nt_password");
}
}
/* Function to find the name of a registered protocol

View File

@ -70,7 +70,7 @@ struct ptvcursor {
};
/* Candidates for assembler */
int
int
wrs_count_bitshift(guint32 bitmask)
{
int bitshift = 0;
@ -85,7 +85,7 @@ wrs_count_bitshift(guint32 bitmask)
#if GLIB_MAJOR_VERSION < 2
static void *discard_const(const void *const_ptr)
{
union {
union {
const void *const_ptr;
void *ptr;
} stupid_const;
@ -300,7 +300,7 @@ gpa_hfinfo_t gpa_hfinfo;
static GTree *gpa_name_tree = NULL;
static header_field_info *same_name_hfinfo;
#if GLIB_MAJOR_VERSION >= 2
#if GLIB_MAJOR_VERSION >= 2
static void save_same_name_hfinfo(gpointer data)
{
same_name_hfinfo = (header_field_info*)data;
@ -358,8 +358,8 @@ proto_init(void (register_all_protocols)(register_cb cb, gpointer client_data),
gpa_hfinfo.len=0;
gpa_hfinfo.allocated_len=0;
gpa_hfinfo.hfi=NULL;
#if GLIB_MAJOR_VERSION < 2
gpa_name_tree = g_tree_new(wrs_strcmp);
#if GLIB_MAJOR_VERSION < 2
gpa_name_tree = g_tree_new(wrs_strcmp);
#else
gpa_name_tree = g_tree_new_full(wrs_strcmp_with_data, NULL, NULL, save_same_name_hfinfo);
#endif
@ -381,7 +381,7 @@ proto_init(void (register_all_protocols)(register_cb cb, gpointer client_data),
#ifdef HAVE_PLUGINS
/* Now scan for plugins and load all the ones we find, calling
their register routines to do the stuff described above. */
if(cb)
if(cb)
(*cb)(RA_PLUGIN_REGISTER, NULL, client_data);
init_plugins();
register_all_plugin_registrations();
@ -395,7 +395,7 @@ proto_init(void (register_all_protocols)(register_cb cb, gpointer client_data),
#ifdef HAVE_PLUGINS
/* Now do the same with plugins. */
if(cb)
if(cb)
(*cb)(RA_PLUGIN_HANDOFF, NULL, client_data);
register_all_plugin_handoffs();
#endif
@ -733,9 +733,9 @@ ptvcursor_set_tree(ptvcursor_t* ptvc, proto_tree *tree)
ptvc->tree = tree;
}
/* creates a subtree, sets it as the working tree and pushes the old working tree */
proto_tree*
ptvcursor_push_subtree(ptvcursor_t *ptvc, proto_item *it, gint ett_subtree)
/* creates a subtree, sets it as the working tree and pushes the old working tree */
proto_tree*
ptvcursor_push_subtree(ptvcursor_t *ptvc, proto_item *it, gint ett_subtree)
{
subtree_lvl * subtree;
if (ptvc->pushed_tree_index >= ptvc->pushed_tree_max)
@ -749,8 +749,8 @@ ptvcursor_push_subtree(ptvcursor_t *ptvc, proto_item *it, gint ett_subtree)
}
/* pops a subtree */
void
ptvcursor_pop_subtree(ptvcursor_t *ptvc)
void
ptvcursor_pop_subtree(ptvcursor_t *ptvc)
{
subtree_lvl * subtree;
if (ptvc->pushed_tree_index <= 0)
@ -758,7 +758,7 @@ ptvcursor_pop_subtree(ptvcursor_t *ptvc)
ptvc->pushed_tree_index--;
subtree = ptvc->pushed_tree+ptvc->pushed_tree_index;
if (subtree->it != NULL)
if (subtree->it != NULL)
proto_item_set_len(subtree->it, ptvcursor_current_offset(ptvc) - subtree->cursor_offset);
ptvc->tree = subtree->tree;
}
@ -777,8 +777,8 @@ void ptvcursor_subtree_set_item(ptvcursor_t * ptvc, proto_item * it)
/* Creates a subtree and adds it to the cursor as the working tree but does not
* save the old working tree */
proto_tree*
ptvcursor_set_subtree(ptvcursor_t *ptvc, proto_item *it, gint ett_subtree)
proto_tree*
ptvcursor_set_subtree(ptvcursor_t *ptvc, proto_item *it, gint ett_subtree)
{
ptvc->tree = proto_item_add_subtree(it, ett_subtree);
return ptvc->tree;
@ -797,7 +797,7 @@ proto_tree* ptvcursor_add_subtree_item(ptvcursor_t * ptvc, proto_item * it, gint
* In this case, when the subtree will be closed, the parent item length will
* be equal to the advancement of the cursor since the creation of the subtree.
*/
proto_tree* ptvcursor_add_with_subtree(ptvcursor_t * ptvc, int hfindex, gint length,
proto_tree* ptvcursor_add_with_subtree(ptvcursor_t * ptvc, int hfindex, gint length,
gboolean little_endian, gint ett_subtree)
{
proto_item * it;
@ -813,13 +813,13 @@ proto_tree_add_text_node(proto_tree *tree, tvbuff_t *tvb, gint start, gint lengt
* In this case, when the subtree will be closed, the item length will be equal
* to the advancement of the cursor since the creation of the subtree.
*/
proto_tree * ptvcursor_add_text_with_subtree(ptvcursor_t * ptvc, gint length,
proto_tree * ptvcursor_add_text_with_subtree(ptvcursor_t * ptvc, gint length,
gint ett_subtree, const char *format, ...)
{
proto_item * it;
va_list ap;
it = proto_tree_add_text_node(ptvcursor_tree(ptvc), ptvcursor_tvbuff(ptvc),
it = proto_tree_add_text_node(ptvcursor_tree(ptvc), ptvcursor_tvbuff(ptvc),
ptvcursor_current_offset(ptvc), length);
va_start(ap, format);
@ -2013,7 +2013,7 @@ proto_tree_set_uint64_tvb(field_info *fi, tvbuff_t *tvb, gint start, guint leng
{
guint64 value = 0;
guint8* b = ep_tvb_memdup(tvb,start,length);
if(little_endian) {
b += length;
switch(length) {
@ -2042,7 +2042,7 @@ proto_tree_set_uint64_tvb(field_info *fi, tvbuff_t *tvb, gint start, guint leng
break;
}
}
proto_tree_set_uint64(fi, value);
}
@ -3700,6 +3700,8 @@ proto_get_protocol_filter_name(int proto_id)
protocol_t *protocol;
protocol = find_protocol_by_id(proto_id);
if (protocol == NULL)
return "(none)";
return protocol->filter_name;
}
@ -3778,7 +3780,7 @@ proto_register_field_array(int parent, hf_register_info *hf, int num_records)
}
/* chars allowed in field abbrev */
static
static
const guchar fld_abbrev_chars[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00-0x0F */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10-0x1F */
@ -3796,7 +3798,7 @@ const guchar fld_abbrev_chars[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0-0xDF */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0-0xEF */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xF0-0xFF */
};
};
/* temporary function containing assert part for easier profiling */
static void tmp_fld_check_assert(header_field_info *hfinfo) {
@ -3896,14 +3898,14 @@ proto_register_field_init(header_field_info *hfinfo, int parent)
* a byte, and we want to be able to refer to that field
* with one name regardless of whether the packets
* are modulo-8 or modulo-128 packets. */
#if GLIB_MAJOR_VERSION < 2
same_name_hfinfo = g_tree_lookup(gpa_name_tree, discard_const(hfinfo->abbrev));
#if GLIB_MAJOR_VERSION < 2
same_name_hfinfo = g_tree_lookup(gpa_name_tree, discard_const(hfinfo->abbrev));
#else
same_name_hfinfo = NULL;
#endif
g_tree_insert(gpa_name_tree, (gpointer) (hfinfo->abbrev), hfinfo);
/* GLIB 2.x - if it is already present
* the previous hfinfo with the same name is saved
/* GLIB 2.x - if it is already present
* the previous hfinfo with the same name is saved
* to same_name_hfinfo by value destroy callback */
if (same_name_hfinfo) {
/* There's already a field with this name.
@ -5734,7 +5736,7 @@ proto_tree_add_bits_item(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint bit
return proto_tree_add_bits_ret_val(tree, hf_index, tvb, bit_offset, no_of_bits, NULL, little_endian);
}
/*
/*
* This function will dissect a sequence of bits that does not need to be byte aligned the bits
* set vill be shown in the tree as ..10 10.. and the integer value returned if return_value is set.
* Offset should be given in bits from the start of the tvb.
@ -5760,7 +5762,7 @@ proto_tree_add_bits_ret_val(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
offset = bit_offset>>3;
/*
/*
* Calculate the number of octets used to hold the bits
*/
tot_no_bits = ((bit_offset&0x7)+no_of_bits);