chiark / gitweb /
Greetings and challenges.
[tripe] / ethereal / packet-tripe.c
index aaad0ec9b486fabfbd0e71d8b5bbac4099a7c12a..4fa84028ed05d39f1ffb18bd87fa18d33de6d2bf 100644 (file)
@@ -64,6 +64,8 @@ static int hf_tripe_ct_seq = -1;
 static int hf_tripe_ct_iv = -1;
 static int hf_tripe_ct_ct = -1;
 static int hf_tripe_ct_tag = -1;
+static int hf_tripe_misc_type = -1;
+static int hf_tripe_misc_payload = -1;
 static int hf_tripe_kx_type = -1;
 static hfge hf_tripe_kx_mychal = { -1, -1, -1, -1, -1, -1, -1, -1 };
 static int hf_tripe_kx_mycookie = -1;
@@ -178,6 +180,36 @@ static void dissect_tripe(tvbuff_t *b, packet_info *p, proto_tree *t)
            break;
        }
        break;
+      case MSG_MISC:
+       switch (ty & MSG_TYPEMASK) {
+         case MISC_NOP:
+           col_set_str(p->cinfo, COL_INFO, "Miscellaneous, no-operation");
+           break;
+         case MISC_PING:
+           col_set_str(p->cinfo, COL_INFO, "Miscellaneous, transport ping");
+           break;
+         case MISC_PONG:
+           col_set_str(p->cinfo, COL_INFO,
+                       "Miscellaneous, transport ping reply");
+           break;
+         case MISC_EPING:
+           col_set_str(p->cinfo, COL_INFO, "Miscellaneous, encrypted ping");
+           break;
+         case MISC_EPONG:
+           col_set_str(p->cinfo, COL_INFO,
+                       "Miscellaneous, encrypted ping reply");
+           break;
+         case MISC_GREET:
+           col_set_str(p->cinfo, COL_INFO,
+                       "Miscellaneous, greeting");
+           break;
+         default:
+           col_add_fstr(p->cinfo, COL_INFO,
+                        "Miscellaneous, unknown type code %u",
+                        ty & MSG_TYPEMASK);
+           break;
+       }
+       break;
       default:
        col_add_fstr(p->cinfo, COL_INFO,
                     "Unknown category code %u, unknown type code %u",
@@ -235,6 +267,23 @@ static void dissect_tripe(tvbuff_t *b, packet_info *p, proto_tree *t)
            goto huh;
        }
        break;
+      case MSG_MISC:
+       proto_tree_add_item(tt, hf_tripe_misc_type, b, 0, 1, FALSE);
+       switch (ty & MSG_TYPEMASK) {
+         case MISC_NOP:
+         case MISC_PING:
+         case MISC_PONG:
+         case MISC_GREET:
+           proto_tree_add_item(tt, hf_tripe_misc_payload,
+                               b, off, -1, FALSE);
+           goto done;
+         case MISC_EPING:
+         case MISC_EPONG:
+           goto ct;
+         default:
+           goto huh;
+       }
+       break;
       default:
        goto huh;
     }
@@ -316,6 +365,16 @@ void proto_register_tripe(void)
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the message authentication code tag for the ciphertext."
     } },
+    { &hf_tripe_misc_type, {
+      "Miscellaneous message type", "tripe.misc.type",
+      FT_UINT8, BASE_HEX, 0, MSG_TYPEMASK,
+      "This is the TrIPE miscellaneous message type subcode."
+    } },
+    { &hf_tripe_misc_payload, {
+      "Miscellaneous message payload", "tripe.misc.payload",
+      FT_BYTES, BASE_NONE, 0, 0,
+      "This is the miscellaneous message payload."
+    } },
     { &hf_tripe_kx_type, {
       "Key-exchange message type", "tripe.kx.type",
       FT_UINT8, BASE_HEX, vs_kxtype, MSG_TYPEMASK,
@@ -341,7 +400,7 @@ void proto_register_tripe(void)
       FT_UINT16, BASE_DEC, 0, 0,
       "This is the length of the sender's challenge x-coordinate."
     } },
-    { &hf_tripe_kx_mychal.hfy_val, {
+    { &hf_tripe_kx_mychal.hfx_val, {
       "Challenge x value", "tripe.kx.mychal.x.val",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the value of the sender's challenge x-coordinate."
@@ -351,7 +410,7 @@ void proto_register_tripe(void)
       FT_UINT16, BASE_DEC, 0, 0,
       "This is the length of the sender's challenge x-coordinate."
     } },
-    { &hf_tripe_kx_mychal.hfx_val, {
+    { &hf_tripe_kx_mychal.hfy_val, {
       "Challenge y value", "tripe.kx.mychal.y.val",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the value of the sender's challenge x-coordinate."