Ethereal-dev: [ethereal-dev] Small patch to handle ICMP Unreachable|Fragmentation Required

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: John McDermott <jjm@xxxxxxxxxx>
Date: Mon, 09 Aug 1999 11:55:34 -0600
This patch handles ICMP Unreachable|Fragmentation Required
(see attached)
--john

-- 
John McDermott jjm@xxxxxxxxxx
Writer and Computer Consultant
J-K International, Ltd.
+1 505/377-6293 - V
+1 505/377-6313 - F
*** packet-ip.c.dist	Mon Aug  9 10:27:35 1999
--- packet-ip.c	Mon Aug  9 10:27:49 1999
***************
*** 106,113 ****
--- 106,133 ----
  #define ICMP_IREQREPLY    16
  #define ICMP_MASKREQ      17
  #define ICMP_MASKREPLY    18
  
+ /* ICMP UNREACHABLE */
+ 
+ #define ICMP_NET_UNREACH        0       /* Network Unreachable          */
+ #define ICMP_HOST_UNREACH       1       /* Host Unreachable             */
+ #define ICMP_PROT_UNREACH       2       /* Protocol Unreachable         */
+ #define ICMP_PORT_UNREACH       3       /* Port Unreachable             */
+ #define ICMP_FRAG_NEEDED        4       /* Fragmentation Needed/DF set  */
+ #define ICMP_SR_FAILED          5       /* Source Route failed          */
+ #define ICMP_NET_UNKNOWN        6
+ #define ICMP_HOST_UNKNOWN       7
+ #define ICMP_HOST_ISOLATED      8
+ #define ICMP_NET_ANO            9
+ #define ICMP_HOST_ANO           10
+ #define ICMP_NET_UNR_TOS        11
+ #define ICMP_HOST_UNR_TOS       12
+ #define ICMP_PKT_FILTERED       13      /* Packet filtered */
+ #define ICMP_PREC_VIOLATION     14      /* Precedence violation */
+ #define ICMP_PREC_CUTOFF        15      /* Precedence cut off */     
+ 
+ 
  /* IGMP structs and definitions */
  typedef struct _e_igmp {
    guint8  igmp_v_t; /* combines igmp_v and igmp_t */
    guint8  igmp_unused;
***************
*** 937,944 ****
--- 957,973 ----
  	proto_tree_add_text(icmp_tree, offset +  6, 2, "Sequence number: %u",
  	  pntohs(&pd[offset +  6]));
  	break;
  
+       case ICMP_UNREACH:
+         switch (ih.icmp_code) {
+           case ICMP_FRAG_NEEDED:
+                 proto_tree_add_text(icmp_tree, offset +  6, 2, "MTU of next hop: %u",
+                   pntohs(&pd[offset + 6]));
+                 break;
+           }
+         break;
+       
        case ICMP_RTRADVERT:
          num_addrs = pd[offset + 4];
  	proto_tree_add_text(icmp_tree, offset +  4, 1, "Number of addresses: %u",
  	  num_addrs);