kernels/linux-2.4.0/net/ipv6/netfilter/ip6_tables.c
/* takes in current header and pointer to the header */
/* if another header exists, sets hdrptr to the next header
   and returns the new header value, else returns 0 */
takes in current header and pointer to the header
if another header exists, sets hdrptr to the next header
and returns the new header value, else returns 0
takes in current header and pointer to the header if another header exists sets hdrptr to the next header and returns the new header value else returns 0
static u_int8_t ip6_nexthdr(u_int8_t currenthdr, u_int8_t *hdrptr)
{
	int i;
	u_int8_t hdrlen, nexthdr = 0;
	switch(currenthdr){
		case IPPROTO_AH:
			nexthdr = *hdrptr;
			hdrlen = hdrptr[i] * 4 + 8;
			hdrptr = hdrptr + hdrlen;
			break;
		case IPPROTO_DSTOPTS:
		case IPPROTO_ROUTING:
		case IPPROTO_HOPOPTS:
			nexthdr = *hdrptr;
			hdrlen = hdrptr[1] * 8 + 8;
			hdrptr = hdrptr + hdrlen;
			break;
		case IPPROTO_FRAGMENT:
			nexthdr = *hdrptr;
			hdrptr = hdrptr + 8;
			break;
	}	
	return nexthdr;
}
static u_int8_t ip6_nexthdr ( u_int8_t currenthdr , u_int8_t * hdrptr ) { int i ; u_int8_t hdrlen , nexthdr = 0 ; switch ( currenthdr ) { case IPPROTO_AH : nexthdr = * hdrptr ; hdrlen = hdrptr [ i ] * 4 + 8 ; hdrptr = hdrptr + hdrlen ; break ; case IPPROTO_DSTOPTS : case IPPROTO_ROUTING : case IPPROTO_HOPOPTS : nexthdr = * hdrptr ; hdrlen = hdrptr [ 1 ] * 8 + 8 ; hdrptr = hdrptr + hdrlen ; break ; case IPPROTO_FRAGMENT : nexthdr = * hdrptr ; hdrptr = hdrptr + 8 ; break ; } return nexthdr ; }
takes in current header and pointer to the header
if another header exists, sets hdrptr to the next header
and returns the new header value, else returns 0
takes in current header and pointer to the header if another header exists sets hdrptr to the next header and returns the new header value else returns 0
/* whoever decided to do the length of AUTH for ipv6
		in 32bit units unlike other headers should be beaten...
		repeatedly...with a large stick...no, an even LARGER
		stick...no, you're still not thinking big enough */ /*stupid rfc2402 */