i want to know that when an ICMP port unreachable packets is
viewed in ethereal :
Frame 137 (300 bytes on wire, 300 bytes captured)
Arrival Time: Mar 11, 1999 14:46:01.962117000
Time delta from previous packet: 0.001071000 seconds
Time relative to first packet: 59.820360000 seconds
Frame Number: 137
Packet Length: 300 bytes
Capture Length: 300 bytes
File Offset: 24436 (0x5f74)
Ethernet II, Src: 00:00:86:05:80:da, Dst: 00:60:97:07:69:ea
Destination: 00:60:97:07:69:ea (00:60:97:07:69:ea)
Source: 00:00:86:05:80:da (00:00:86:05:80:da)
Type: IPv6 (0x86dd)
Internet Protocol Version 6
Version: 6
Traffic class: 0x00
Flowlabel: 0x00000
Payload length: 246
Next header: ICMPv6 (0x3a)
Hop limit: 64
Source address: 3ffe:507:0:1:200:86ff:fe05:80da
Destination address: 3ffe:501:4819::42
Internet Control Message Protocol v6
Type: 1 (Unreachable)
Code: 4 (Port unreachable)
Checksum: 0xb1b5 (correct)
Internet Protocol Version 6
Version: 6
Traffic class: 0x00
Flowlabel: 0x00000
Payload length: 198
Next header: UDP (0x11)
Hop limit: 230
Source address: 3ffe:501:4819::42
Destination address: 3ffe:507:0:1:200:86ff:fe05:80da
User Datagram Protocol, Src Port: 53 (53), Dst Port: 2410
(2410)
Source port: 53 (53)
Destination port: 2410 (2410)
Length: 198
Checksum: 0x1e36 (correct)
1st we create ethlen =sizeof(struct ether_header);
iplen =sizeof(struct iphdr);
udplen =sizeof(struct udphdr);
icmplen=sizeof(struct icmphdr);
than how to extract the source and destination port from this icmp
packet.plz help me