aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2009-02-24 17:24:03 +0000
committerjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2009-02-24 17:24:03 +0000
commit3129fdd4379c5ae609af165581276a54e155fbad (patch)
treeddb34ebadd17797a88d9fa9f763c0329f0e30a3a /epan
parent164e8a905733e70a3f55e85ed14419050192a489 (diff)
Add posibility to mark protocol as private. This prevents inadvertent Wiki access.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27533 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r--epan/proto.c20
-rw-r--r--epan/proto.h11
2 files changed, 31 insertions, 0 deletions
diff --git a/epan/proto.c b/epan/proto.c
index f0bfb1091f..e312179847 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -221,6 +221,7 @@ struct _protocol {
GList *last_field; /* pointer to end of list of fields */
gboolean is_enabled; /* TRUE if protocol is enabled */
gboolean can_toggle; /* TRUE if is_enabled can be changed */
+ gboolean is_private; /* TRUE is protocol is private */
};
/* List of all protocols */
@@ -3513,6 +3514,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
protocol->fields = NULL;
protocol->is_enabled = TRUE; /* protocol is enabled by default */
protocol->can_toggle = TRUE;
+ protocol->is_private = FALSE;
/* list will be sorted later by name, when all protocols completed registering */
protocols = g_list_prepend(protocols, protocol);
@@ -3533,6 +3535,24 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
return proto_id;
}
+void
+proto_mark_private(int proto_id)
+{
+ protocol_t *protocol = find_protocol_by_id(proto_id);
+ if (protocol)
+ protocol->is_private = TRUE;
+}
+
+gboolean
+proto_is_private(int proto_id)
+{
+ protocol_t *protocol = find_protocol_by_id(proto_id);
+ if (protocol)
+ return protocol->is_private;
+ else
+ return FALSE;
+}
+
/*
* Routines to use to iterate over the protocols.
* The argument passed to the iterator routines is an opaque cookie to
diff --git a/epan/proto.h b/epan/proto.h
index c1c5867dd8..2ef186e1b1 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -1312,6 +1312,17 @@ proto_item_fill_label(field_info *fi, gchar *label_str);
extern int
proto_register_protocol(const char *name, const char *short_name, const char *filter_name);
+/** Mark protocol as private
+ @param proto_id the handle of the protocol */
+extern void
+proto_mark_private(int proto_id);
+
+/** Return if protocol is private
+ @param proto_id the handle of the protocol
+ @return TRUE if it is a private protocol, FALSE is not. */
+extern gboolean
+proto_is_private(int proto_id);
+
/** This is the type of function can be registered to get called whenever
a given field was not found but a its prefix is matched
it can be used to procrastinate the hf array registration