Beispiel #1
0
int AnalyzeIcmp6(u_char *data,int size)
{
u_char	*ptr;
int	lest;
struct icmp6_hdr	*icmp6;

	ptr=data;
	lest=size;

	if(lest<sizeof(struct icmp6_hdr)){
		if(fil[5] == 1){
		fprintf(stderr,"lest(%d)<sizeof(struct icmp6_hdr)\n",lest);
		}
		return(-1);
	}
	icmp6=(struct icmp6_hdr *)ptr;
	ptr+=sizeof(struct icmp6_hdr);
	lest-=sizeof(struct icmp6_hdr);

	if(fil[5] == 1){
	PrintIcmp6(icmp6,stdout);
	}

	return(0);
}
Beispiel #2
0
int AnalyzeIcmp6(u_char *data, int size) {
  u_char *ptr = NULL;
  int lest = 0;
  struct icmp6_hdr *icmp6 = NULL;

  ptr = data;
  lest = size;

  if (lest < sizeof(struct icmp6_hdr)) {
    ExitWithTooLittleLengthError("icmp6_hdr", lest);
  }

  icmp6 = (struct icmp6_hdr *) ptr;
  ptr += sizeof(struct icmp6_hdr);
  lest -= sizeof(struct icmp6_hdr);

  PrintIcmp6(icmp6, stdout);

  return 0;
}