Пример #1
0
void IPHeader::setCheckSum()
 {
  CheckSum sum;
  
  sum(vhl,tos,len,id,flags_offset,ttl,proto.get(),src.get(),dst.get());
  
  check_sum=sum.complete();
 }
Пример #2
0
void ICMPEcho::setCheckSum(PtrLen<const uint8> data)
 {
  CheckSum sum;
  
  sum(type.get(),code,id,num);
  
  sum.add(data);
  
  check_sum=sum.complete();
 }
Пример #3
0
void UDPHeader::setCheckSum(IPAddress src,IPAddress dst,IPLen len,PtrLen<const uint8> data)
 {
  CheckSum sum;
  
  uint16 proto=IP_UDP;
  
  sum(src.get(),dst.get(),proto,len,src_port,dst_port,len);
  
  sum.add(data);
  
  check_sum=sum.complete();
 }