Index: ipv6.c
===================================================================
RCS file: /cvsroot/apps/tcptrace/ipv6.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ipv6.c
*** ipv6.c	1999/01/19 09:55:32	1.1.1.1
--- ipv6.c	1999/01/19 10:02:27
***************
*** 34,44 ****
      u_char nextheader)
  {
      switch (nextheader) {
!       case IPV6HDR_DSTOPTS: return("Destinations options");
!       case IPV6HDR_FRAGMENT: return("Fragment header");
!       case IPV6HDR_HOPBYHOP: return("Hop by hop");
!       case IPV6HDR_NONXTHDR: return("No next header");
!       case IPV6HDR_ROUTING: return("Routing header");
        case IPPROTO_ICMPV6: return("IPv6 ICMP");
        case IPPROTO_TCP: return("TCP");
        case IPPROTO_UDP: return("UDP");
--- 34,44 ----
      u_char nextheader)
  {
      switch (nextheader) {
!       case IPPROTO_DSTOPTS: return("Destinations options");
!       case IPPROTO_FRAGMENT: return("Fragment header");
!       case IPPROTO_HOPOPTS: return("Hop by hop");
!       case IPPROTO_NONE: return("No next header");
!       case IPPROTO_ROUTING: return("Routing header");
        case IPPROTO_ICMPV6: return("IPv6 ICMP");
        case IPPROTO_TCP: return("TCP");
        case IPPROTO_UDP: return("UDP");
***************
*** 59,73 ****
      switch (*pnextheader) {
  	/* nothing follows these... */
        case IPPROTO_TCP:
!       case IPV6HDR_NONXTHDR:
        case IPPROTO_ICMPV6:
        case IPPROTO_UDP:
  	return(NULL);
  
  	/* somebody follows these */
!       case IPV6HDR_HOPBYHOP:
!       case IPV6HDR_ROUTING:
!       case IPV6HDR_DSTOPTS:
  	*pnextheader = pheader->ip6ext_nheader;
  	return((struct ipv6_ext *)
  	       ((char *)pheader + pheader->ip6ext_len));
--- 59,73 ----
      switch (*pnextheader) {
  	/* nothing follows these... */
        case IPPROTO_TCP:
!       case IPPROTO_NONE:
        case IPPROTO_ICMPV6:
        case IPPROTO_UDP:
  	return(NULL);
  
  	/* somebody follows these */
!       case IPPROTO_HOPOPTS:
!       case IPPROTO_ROUTING:
!       case IPPROTO_DSTOPTS:
  	*pnextheader = pheader->ip6ext_nheader;
  	return((struct ipv6_ext *)
  	       ((char *)pheader + pheader->ip6ext_len));
***************
*** 172,182 ****
  	    return(NULL);	/* didn't find it */
  
  	    /* non-tcp protocols */
! 	  case IPV6HDR_NONXTHDR:
  	  case IPPROTO_ICMPV6:
  
  	    /* fragmentation */
! 	  case IPV6HDR_FRAGMENT:
  	  {
  	      struct ipv6_ext_frag *pfrag = (struct ipv6_ext_frag *)pheader;
  
--- 172,182 ----
  	    return(NULL);	/* didn't find it */
  
  	    /* non-tcp protocols */
! 	  case IPPROTO_NONE:
  	  case IPPROTO_ICMPV6:
  
  	    /* fragmentation */
! 	  case IPPROTO_FRAGMENT:
  	  {
  	      struct ipv6_ext_frag *pfrag = (struct ipv6_ext_frag *)pheader;
  
***************
*** 197,205 ****
  	  }
  
  	  /* headers we just skip over */
! 	  case IPV6HDR_HOPBYHOP:
! 	  case IPV6HDR_ROUTING:
! 	  case IPV6HDR_DSTOPTS:
  	      nextheader = pheader->ip6ext_nheader;
  	      pheader = (struct ipv6_ext *)
  		  ((char *)pheader + pheader->ip6ext_len);
--- 197,205 ----
  	  }
  
  	  /* headers we just skip over */
! 	  case IPPROTO_HOPOPTS:
! 	  case IPPROTO_ROUTING:
! 	  case IPPROTO_DSTOPTS:
  	      nextheader = pheader->ip6ext_nheader;
  	      pheader = (struct ipv6_ext *)
  		  ((char *)pheader + pheader->ip6ext_len);
***************
*** 271,290 ****
  	pipv6 = (struct ipv6 *) pip;
  	while (1)
  	{
! 	    if (nextheader == IPV6HDR_NONXTHDR)
  		return length;
  	    if (nextheader == IPPROTO_TCP)
  		return length;
  	    if (nextheader == IPPROTO_UDP)
  		return length;
! 	    if (nextheader == IPV6HDR_FRAGMENT)
  	    {
  		nextheader = *pheader;
  		pheader += 8;
  		length += 8;
  	    }
! 	    if ((nextheader == IPV6HDR_HOPBYHOP) || (nextheader == IPV6HDR_ROUTING)
! 		|| (nextheader == IPV6HDR_DSTOPTS))
  	    {
  		nextheader = *pheader;
  		pheader += *(pheader + 1);
--- 271,290 ----
  	pipv6 = (struct ipv6 *) pip;
  	while (1)
  	{
! 	    if (nextheader == IPPROTO_NONE)
  		return length;
  	    if (nextheader == IPPROTO_TCP)
  		return length;
  	    if (nextheader == IPPROTO_UDP)
  		return length;
! 	    if (nextheader == IPPROTO_FRAGMENT)
  	    {
  		nextheader = *pheader;
  		pheader += 8;
  		length += 8;
  	    }
! 	    if ((nextheader == IPPROTO_HOPOPTS) || (nextheader == IPPROTO_ROUTING)
! 		|| (nextheader == IPPROTO_DSTOPTS))
  	    {
  		nextheader = *pheader;
  		pheader += *(pheader + 1);
Index: ipv6.h
===================================================================
RCS file: /cvsroot/apps/tcptrace/ipv6.h,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ipv6.h
*** ipv6.h	1999/01/19 09:55:32	1.1.1.1
--- ipv6.h	1999/01/19 10:02:27
***************
*** 35,55 ****
   */
  #include <sys/types.h>
  
  #define ETHERTYPE_IPV6 0x86DD	/* Ethernet type for ipv6 */
  
! #ifndef IPV6HDR_NONXTHDR
  /* when IPv6 is more widely/standardly deployed, these constants won't need to be
     here.  In the mean time, here's the stuff we need... */
  #define IPV6NOTFOUND
  
  /* header types */
! #define	IPV6HDR_HOPBYHOP	0		/* Hop by hop header for v6 */
  #define	IPPROTO_IPV6		41		/* IPv6 encapsulated in IP */
! #define	IPV6HDR_ROUTING		43		/* Routing header for IPv6 */
! #define	IPV6HDR_FRAGMENT	44		/* Fragment header for IPv6 */
  #define	IPPROTO_ICMPV6		58		/* ICMP for IPv6 */
! #define	IPV6HDR_NONXTHDR	59		/* No next header for IPv6 */
! #define	IPV6HDR_DSTOPTS		60		/* Destinations options */
  
  /* other constants we need */
  #define INET6_ADDRSTRLEN        46              /* IPv6 Address length in a string format*/
--- 35,58 ----
   */
  #include <sys/types.h>
  
+ #ifndef ETHERTYPE_IPV6
  #define ETHERTYPE_IPV6 0x86DD	/* Ethernet type for ipv6 */
+ #endif
  
! /* just guessing... */
! #if !defined(IPPROTO_NONE) && !defined(IPPROTO_FRAGMENT) && !defined(IPPROTO_DSTOPTS)
  /* when IPv6 is more widely/standardly deployed, these constants won't need to be
     here.  In the mean time, here's the stuff we need... */
  #define IPV6NOTFOUND
  
  /* header types */
! #define	IPPROTO_HOPOPTS		0		/* Hop by hop header for v6 */
  #define	IPPROTO_IPV6		41		/* IPv6 encapsulated in IP */
! #define	IPPROTO_ROUTING		43		/* Routing header for IPv6 */
! #define	IPPROTO_FRAGMENT	44		/* Fragment header for IPv6 */
  #define	IPPROTO_ICMPV6		58		/* ICMP for IPv6 */
! #define	IPPROTO_NONE		59		/* No next header for IPv6 */
! #define	IPPROTO_DSTOPTS		60		/* Destinations options */
  
  /* other constants we need */
  #define INET6_ADDRSTRLEN        46              /* IPv6 Address length in a string format*/
***************
*** 74,80 ****
  const char *inet_ntop(int, const char *, char *, size_t);
  #endif /* HAVE_INET_NTOP */
  
! #endif /* notdef IPV6HDR_NONXTHDR */
  
  
  /*
--- 77,83 ----
  const char *inet_ntop(int, const char *, char *, size_t);
  #endif /* HAVE_INET_NTOP */
  
! #endif /* notdef IPPROTO_NONE */
  
  
  /*
