aboutsummaryrefslogtreecommitdiffstats
path: root/dfilter.c
diff options
context:
space:
mode:
authorLaurent Deniel <laurent.deniel@free.fr>1999-10-11 17:05:49 +0000
committerLaurent Deniel <laurent.deniel@free.fr>1999-10-11 17:05:49 +0000
commit2e08b800b4e568a1f401441ee80153d566d532dc (patch)
treea1f5edd83ac9f6dcdb2b88ac484ed44d9771a1b9 /dfilter.c
parentc6d6deee3cf80aafc7eba03df304c0b405341aef (diff)
- add handling of FT_IPv6 variables
there is still some work to do in resolv.c (get_host_ipaddr6) - add display filters of this kind in packet-ipv6.c just for testing (display filtering is incomplete) svn path=/trunk/; revision=808
Diffstat (limited to 'dfilter.c')
-rw-r--r--dfilter.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/dfilter.c b/dfilter.c
index 00b832219a..56ac93d336 100644
--- a/dfilter.c
+++ b/dfilter.c
@@ -1,7 +1,7 @@
/* dfilter.c
* Routines for display filters
*
- * $Id: dfilter.c,v 1.27 1999/10/11 14:58:00 gram Exp $
+ * $Id: dfilter.c,v 1.28 1999/10/11 17:04:34 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -333,6 +333,7 @@ dfilter_apply_node(GNode *gnode, proto_tree *ptree, const guint8* pd, guint len)
case numeric:
case ipv4:
+ case ipv6:
case boolean:
case ether:
case string:
@@ -493,6 +494,18 @@ gboolean fill_array_ether_variable(GNode *gnode, gpointer data)
return FALSE; /* FALSE = do not end traversal of GNode tree */
}
+gboolean fill_array_ipv6_variable(GNode *gnode, gpointer data)
+{
+ proto_tree_search_info *sinfo = (proto_tree_search_info*)data;
+ field_info *fi = (field_info*) (gnode->data);
+
+ if (fi->hfinfo->id == sinfo->target) {
+ g_array_append_val(sinfo->result.array, fi->value.ipv6);
+ }
+
+ return FALSE; /* FALSE = do not end traversal of GNode tree */
+}
+
gboolean fill_array_bytes_variable(GNode *gnode, gpointer data)
{
proto_tree_search_info *sinfo = (proto_tree_search_info*)data;
@@ -530,6 +543,16 @@ gboolean fill_array_ether_value(GNode *gnode, gpointer data)
return FALSE; /* FALSE = do not end traversal of GNode tree */
}
+gboolean fill_array_ipv6_value(GNode *gnode, gpointer data)
+{
+ GArray *array = (GArray*)data;
+ dfilter_node *dnode = (dfilter_node*) (gnode->data);
+
+ g_array_append_val(array, dnode->value.ipv6);
+
+ return FALSE; /* FALSE = do not end traversal of GNode tree */
+}
+
gboolean fill_array_bytes_value(GNode *gnode, gpointer data)
{
GArray *array = (GArray*)data;
@@ -619,6 +642,42 @@ gboolean check_relation_numeric(gint operand, GArray *a, GArray *b)
return FALSE;
}
+gboolean check_relation_ipv6(gint operand, GArray *a, GArray *b)
+{
+ int i, j, len_a, len_b;
+ guint8 *ptr_a, *ptr_b;
+
+ len_a = a->len;
+ len_b = b->len;
+
+
+ switch(operand) {
+ case TOK_EQ:
+ for(i = 0; i < len_a; i++) {
+ ptr_a = g_array_index_ptr(a, 16, i);
+ for (j = 0; j < len_b; j++) {
+ ptr_b = g_array_index_ptr(b, 16, j);
+ if (memcmp(ptr_a, ptr_b, 16) == 0)
+ return TRUE;
+ }
+ }
+ return FALSE;
+
+ case TOK_NE:
+ for(i = 0; i < len_a; i++) {
+ ptr_a = g_array_index_ptr(a, 16, i);
+ for (j = 0; j < len_b; j++) {
+ ptr_b = g_array_index_ptr(b, 16, j);
+ if (memcmp(ptr_a, ptr_b, 16) != 0)
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+
+ g_assert_not_reached();
+ return FALSE;
+}
gboolean check_relation_ether(gint operand, GArray *a, GArray *b)
{