add ipcomp.flags to filter notation.
authorJun-ichiro itojun Hagino <itojun@itojun.org>
Fri, 15 Oct 1999 05:46:18 +0000 (05:46 -0000)
committerJun-ichiro itojun Hagino <itojun@itojun.org>
Fri, 15 Oct 1999 05:46:18 +0000 (05:46 -0000)
fix hexadecimal matching in lexer ("0x[a-fA-F0-9]+"), need more improvement.

svn path=/trunk/; revision=839

dfilter-scanner.l
packet-ipsec.c

index dd883ae8a62af5e90485ab46d691fe8c9da85b2c..61c1c0da0a387206a3e01e1dc30c281566049e37 100644 (file)
@@ -3,7 +3,7 @@
 /* dfilter-scanner.l
  * Scanner for display filters
  *
- * $Id: dfilter-scanner.l,v 1.21 1999/10/15 04:22:47 itojun Exp $
+ * $Id: dfilter-scanner.l,v 1.22 1999/10/15 05:46:17 itojun Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -167,7 +167,11 @@ le|\<\=            { dfilter_lval.operand = TOK_LE; return TOK_LE; }
        dfilter_lval.variable.id = dfilter_lookup_token(yytext);
        if (dfilter_lval.variable.id < 0) {
                dfilter_lval.string = g_strdup(yytext);
-               return T_VAL_UNQUOTED_STRING;
+               if (strncmp("0x", yytext, 2) == 0
+                || strncmp("0X", yytext, 2) == 0) {
+                       return T_VAL_NUMBER_STRING;
+               } else
+                       return T_VAL_UNQUOTED_STRING;
        }
        
        ftype = proto_registrar_get_ftype(dfilter_lval.variable.id);
index e6654e0a09039859bf4b29ef3db001cc699f2228..0259e118cdd9d65ff65b38df81ba6fac83dd7349 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-ipsec.c
  * Routines for IPsec/IPComp packet disassembly 
  *
- * $Id: packet-ipsec.c,v 1.7 1999/10/15 05:30:40 itojun Exp $
+ * $Id: packet-ipsec.c,v 1.8 1999/10/15 05:46:18 itojun Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -48,6 +48,7 @@ static int proto_esp = -1;
 static int hf_esp_spi = -1;
 static int hf_esp_sequence = -1;
 static int proto_ipcomp = -1;
+static int hf_ipcomp_flags = -1;
 static int hf_ipcomp_cpi = -1;
 
 struct newah {
@@ -217,9 +218,9 @@ dissect_ipcomp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
            offset + offsetof(struct ipcomp, comp_nxt), 1,
            "Next Header: %s (0x%02x)",
            ipprotostr(ipcomp.comp_nxt), ipcomp.comp_nxt);
-       proto_tree_add_text(ipcomp_tree,
+       proto_tree_add_item(ipcomp_tree, hf_ipcomp_flags,
            offset + offsetof(struct ipcomp, comp_flags), 1,
-           "Flags: 0x%02x", ipcomp.comp_flags);
+           ipcomp.comp_flags);
        p = val_to_str(ntohs(ipcomp.comp_cpi), cpi2val, "");
        if (p[0] == '\0') {
            proto_tree_add_item(ipcomp_tree, hf_ipcomp_cpi, 
@@ -259,6 +260,9 @@ proto_register_ipsec(void)
   };
 
   static hf_register_info hf_ipcomp[] = {
+    { &hf_ipcomp_flags,
+      { "Flags",       "ipcomp.flags", FT_UINT8,       BASE_HEX, NULL, 0x0,
+       "" }},
     { &hf_ipcomp_cpi,
       { "CPI",         "ipcomp.cpi",   FT_UINT16,      BASE_HEX, NULL, 0x0,
        "" }},